@rpg-engine/long-bow 0.1.71 → 0.1.74

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,8 +13,8 @@ var Draggable = _interopDefault(require('react-draggable'));
13
13
  var uuid = require('uuid');
14
14
  require('rpgui/rpgui.min.css');
15
15
  require('rpgui/rpgui.min.js');
16
- var mobxReact = require('mobx-react');
17
16
  var shared = require('@rpg-engine/shared');
17
+ var mobxReact = require('mobx-react');
18
18
  var mobx = require('mobx');
19
19
 
20
20
  function _extends() {
@@ -354,8 +354,10 @@ var DraggableContainer = function DraggableContainer(_ref) {
354
354
  document.removeEventListener('clickOutside', function (_e) {});
355
355
  };
356
356
  }, []);
357
- return React__default.createElement("div", {
358
- ref: draggableRef
357
+ return React__default.createElement(DraggableRef, {
358
+ ref: draggableRef,
359
+ width: width,
360
+ height: height || 'auto'
359
361
  }, React__default.createElement(Draggable, {
360
362
  cancel: ".container-close," + cancelDrag,
361
363
  onDrag: function onDrag(_e, data) {
@@ -381,30 +383,39 @@ var DraggableContainer = function DraggableContainer(_ref) {
381
383
  onTouchStart: onCloseButton
382
384
  }, "X"), children)));
383
385
  };
384
- var Container$2 = /*#__PURE__*/styled.div.withConfig({
385
- displayName: "DraggableContainer__Container",
386
+ var DraggableRef = /*#__PURE__*/styled.div.withConfig({
387
+ displayName: "DraggableContainer__DraggableRef",
386
388
  componentId: "sc-184mpyl-0"
387
- })(["height:", ";width:", ";display:flex;flex-wrap:wrap;image-rendering:pixelated;&.rpgui-container{padding-top:1.5rem;}"], function (props) {
389
+ })(["height:", ";width:", ";"], function (props) {
388
390
  return props.height;
389
391
  }, function (_ref2) {
390
392
  var width = _ref2.width;
391
393
  return width;
392
394
  });
395
+ var Container$2 = /*#__PURE__*/styled.div.withConfig({
396
+ displayName: "DraggableContainer__Container",
397
+ componentId: "sc-184mpyl-1"
398
+ })(["height:", ";width:", ";display:flex;flex-wrap:wrap;image-rendering:pixelated;&.rpgui-container{padding-top:1.5rem;}"], function (props) {
399
+ return props.height;
400
+ }, function (_ref3) {
401
+ var width = _ref3.width;
402
+ return width;
403
+ });
393
404
  var CloseButton$1 = /*#__PURE__*/styled.div.withConfig({
394
405
  displayName: "DraggableContainer__CloseButton",
395
- componentId: "sc-184mpyl-1"
406
+ componentId: "sc-184mpyl-2"
396
407
  })(["position:absolute;top:3px;right:0px;color:white;z-index:22;font-size:0.8rem;"]);
397
408
  var TitleContainer = /*#__PURE__*/styled.div.withConfig({
398
409
  displayName: "DraggableContainer__TitleContainer",
399
- componentId: "sc-184mpyl-2"
410
+ componentId: "sc-184mpyl-3"
400
411
  })(["width:100%;height:100%;display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;"]);
401
412
  var Title = /*#__PURE__*/styled.h1.withConfig({
402
413
  displayName: "DraggableContainer__Title",
403
- componentId: "sc-184mpyl-3"
414
+ componentId: "sc-184mpyl-4"
404
415
  })(["color:white;z-index:22;font-size:0.6rem;"]);
405
416
  var Icon = /*#__PURE__*/styled.img.withConfig({
406
417
  displayName: "DraggableContainer__Icon",
407
- componentId: "sc-184mpyl-4"
418
+ componentId: "sc-184mpyl-5"
408
419
  })(["color:white;z-index:22;font-size:10px;width:", ";margin-right:0.5rem;"], function (props) {
409
420
  return props.width;
410
421
  });
@@ -456,152 +467,23 @@ var Dropdown = function Dropdown(_ref) {
456
467
  }));
457
468
  };
458
469
 
459
- var SlotsContainer = function SlotsContainer(_ref) {
460
- var children = _ref.children,
461
- title = _ref.title,
462
- onClose = _ref.onClose,
463
- _onPositionChange = _ref.onPositionChange,
464
- onOutsideClick = _ref.onOutsideClick;
465
- return React__default.createElement(DraggableContainer, {
466
- title: title,
467
- type: exports.RPGUIContainerTypes.Framed,
468
- onCloseButton: function onCloseButton() {
469
- if (onClose) {
470
- onClose();
471
- }
472
- },
473
- width: "330px",
474
- cancelDrag: ".item-container-body",
475
- onPositionChange: function onPositionChange(_ref2) {
476
- var x = _ref2.x,
477
- y = _ref2.y;
478
-
479
- if (_onPositionChange) {
480
- _onPositionChange({
481
- x: x,
482
- y: y
483
- });
484
- }
485
- },
486
- onOutsideClick: onOutsideClick
487
- }, children);
488
- };
489
-
490
- var ListMenu = function ListMenu(_ref) {
491
- var options = _ref.options,
492
- onSelected = _ref.onSelected,
470
+ var ItemCard = function ItemCard(_ref) {
471
+ var item = _ref.item,
493
472
  x = _ref.x,
494
- y = _ref.y,
495
- _ref$fontSize = _ref.fontSize,
496
- fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
473
+ y = _ref.y;
497
474
  return React__default.createElement(Container$3, {
498
475
  x: x,
499
- y: y,
500
- fontSize: fontSize
501
- }, React__default.createElement("ul", {
502
- className: "rpgui-list-imp",
503
- style: {
504
- overflow: 'hidden'
505
- }
506
- }, options.map(function (params) {
507
- return React__default.createElement(ListElement, {
508
- key: params == null ? void 0 : params.id,
509
- onClick: function onClick() {
510
- onSelected(params == null ? void 0 : params.id);
511
- }
512
- }, (params == null ? void 0 : params.text) || 'No text');
513
- })));
476
+ y: y
477
+ }, item == null ? void 0 : item.name);
514
478
  };
515
479
  var Container$3 = /*#__PURE__*/styled.div.withConfig({
516
- displayName: "ListMenu__Container",
517
- componentId: "sc-i9097t-0"
518
- })(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", "em;}"], function (props) {
480
+ displayName: "ItemCard__Container",
481
+ componentId: "sc-170rits-0"
482
+ })(["position:absolute;top:", "px;left:", "px;font-size:0.5rem;color:white;background-color:black;border-radius:5px;padding:0.5rem;min-width:20px;opacity:0.5;"], function (props) {
519
483
  return props.y || 0;
520
484
  }, function (props) {
521
485
  return props.x || 0;
522
- }, function (props) {
523
- return props.fontSize;
524
486
  });
525
- var ListElement = /*#__PURE__*/styled.li.withConfig({
526
- displayName: "ListMenu__ListElement",
527
- componentId: "sc-i9097t-1"
528
- })(["margin-right:0.5rem;"]);
529
-
530
- var ContainerType;
531
-
532
- (function (ContainerType) {
533
- ContainerType["INVENTORY"] = "Inventory";
534
- ContainerType["EQUIPMENT_SET"] = "EquipmentSet";
535
- })(ContainerType || (ContainerType = {})); // TODO: Refactor this file
536
-
537
-
538
- var generateContextList = function generateContextList(actionsByTypeList) {
539
- var contextMenu = actionsByTypeList.map(function (action) {
540
- return {
541
- id: action,
542
- text: shared.ItemSocketEventsDisplayLabels[action]
543
- };
544
- });
545
- return contextMenu;
546
- };
547
-
548
- var handleContextMenuList = function handleContextMenuList(itemType) {
549
- var contextActionMenu = [];
550
-
551
- switch (itemType) {
552
- case shared.ItemType.Weapon:
553
- case shared.ItemType.Armor:
554
- case shared.ItemType.Accessory:
555
- case shared.ItemType.Jewelry:
556
- case shared.ItemType.Tool:
557
- contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
558
- break;
559
-
560
- case shared.ItemType.Consumable:
561
- contextActionMenu = generateContextList(shared.ActionsByItemType.Consumable);
562
- break;
563
-
564
- case shared.ItemType.CraftMaterial:
565
- contextActionMenu = generateContextList(shared.ActionsByItemType.CraftMaterial);
566
- break;
567
-
568
- case shared.ItemType.Other:
569
- case shared.ItemType.Information:
570
- case shared.ItemType.Quest:
571
- case shared.ItemType.Container:
572
- contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
573
- break;
574
-
575
- default:
576
- contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
577
- break;
578
- }
579
-
580
- return contextActionMenu;
581
- };
582
- var handleEquipmentContextMenuList = function handleEquipmentContextMenuList(itemType) {
583
- var contextActionMenu = [];
584
-
585
- switch (itemType) {
586
- case shared.ItemType.Weapon:
587
- case shared.ItemType.Armor:
588
- case shared.ItemType.Accessory:
589
- case shared.ItemType.Jewelry:
590
- case shared.ItemType.Tool:
591
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
592
- break;
593
-
594
- case shared.ItemType.Container:
595
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetContainer);
596
- break;
597
-
598
- default:
599
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
600
- break;
601
- }
602
-
603
- return contextActionMenu;
604
- };
605
487
 
606
488
  var frames = {
607
489
  "helmets/berserkers-helmet.png": {
@@ -6799,8 +6681,11 @@ var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
6799
6681
  width = _ref$width === void 0 ? shared.GRID_WIDTH : _ref$width,
6800
6682
  _ref$height = _ref.height,
6801
6683
  height = _ref$height === void 0 ? shared.GRID_HEIGHT : _ref$height,
6802
- _ref$scale = _ref.scale,
6803
- scale = _ref$scale === void 0 ? 2 : _ref$scale,
6684
+ _ref$imgScale = _ref.imgScale,
6685
+ imgScale = _ref$imgScale === void 0 ? 2 : _ref$imgScale,
6686
+ imgStyle = _ref.imgStyle,
6687
+ onClick = _ref.onClick,
6688
+ containerStyle = _ref.containerStyle,
6804
6689
  _ref$grayScale = _ref.grayScale,
6805
6690
  grayScale = _ref$grayScale === void 0 ? false : _ref$grayScale,
6806
6691
  _ref$opacity = _ref.opacity,
@@ -6811,19 +6696,22 @@ var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
6811
6696
  return React__default.createElement(Container$4, {
6812
6697
  width: width,
6813
6698
  height: height,
6814
- hasHover: grayScale
6699
+ hasHover: grayScale,
6700
+ onClick: onClick,
6701
+ style: containerStyle
6815
6702
  }, React__default.createElement(ImgSprite, {
6816
6703
  className: "sprite-from-atlas-img",
6817
6704
  atlasIMG: atlasIMG,
6818
6705
  frame: spriteData.frame,
6819
- scale: scale,
6706
+ scale: imgScale,
6820
6707
  grayScale: grayScale,
6821
- opacity: opacity
6708
+ opacity: opacity,
6709
+ style: imgStyle
6822
6710
  }));
6823
6711
  };
6824
6712
  var Container$4 = /*#__PURE__*/styled.div.withConfig({
6825
6713
  displayName: "SpriteFromAtlas__Container",
6826
- componentId: "sc-v74jf1-0"
6714
+ componentId: "sc-1lpani8-0"
6827
6715
  })(["width:", "px;height:", "px;", ""], function (props) {
6828
6716
  return props.width;
6829
6717
  }, function (props) {
@@ -6833,7 +6721,7 @@ var Container$4 = /*#__PURE__*/styled.div.withConfig({
6833
6721
  });
6834
6722
  var ImgSprite = /*#__PURE__*/styled.div.withConfig({
6835
6723
  displayName: "SpriteFromAtlas__ImgSprite",
6836
- componentId: "sc-v74jf1-1"
6724
+ componentId: "sc-1lpani8-1"
6837
6725
  })(["width:", "px;height:", "px;background-image:url(", ");background-position:-", "px -", "px;transform:scale(", ");position:relative;top:8px;left:8px;filter:", ";opacity:", ";"], function (props) {
6838
6726
  return props.frame.w;
6839
6727
  }, function (props) {
@@ -6892,7 +6780,7 @@ var ItemSlot = function ItemSlot(_ref) {
6892
6780
  atlasIMG: img,
6893
6781
  atlasJSON: atlasJSON,
6894
6782
  spriteKey: itemToRender.texturePath,
6895
- scale: 3
6783
+ imgScale: 3
6896
6784
  }));
6897
6785
  }
6898
6786
 
@@ -6913,14 +6801,14 @@ var ItemSlot = function ItemSlot(_ref) {
6913
6801
  atlasIMG: img,
6914
6802
  atlasJSON: atlasJSON,
6915
6803
  spriteKey: itemToRender.texturePath,
6916
- scale: 3
6804
+ imgScale: 3
6917
6805
  });
6918
6806
  } else {
6919
6807
  return React__default.createElement(SpriteFromAtlas, {
6920
6808
  atlasIMG: img,
6921
6809
  atlasJSON: atlasJSON,
6922
6810
  spriteKey: EquipmentSlotSpriteByType[slotSpriteMask],
6923
- scale: 3,
6811
+ imgScale: 3,
6924
6812
  grayScale: true,
6925
6813
  opacity: 0.4
6926
6814
  });
@@ -6960,45 +6848,161 @@ var ItemQty = /*#__PURE__*/styled.span.withConfig({
6960
6848
  return props.left;
6961
6849
  });
6962
6850
 
6963
- var initialState = {
6964
- visible: false,
6965
- posX: 0,
6966
- posY: 0,
6967
- contextActions: [],
6968
- slotItem: null
6969
- };
6970
- var initialHoverState = {
6971
- visible: false,
6972
- posX: 0,
6973
- posY: 0,
6974
- item: null
6851
+ var ListMenu = function ListMenu(_ref) {
6852
+ var options = _ref.options,
6853
+ onSelected = _ref.onSelected,
6854
+ x = _ref.x,
6855
+ y = _ref.y,
6856
+ _ref$fontSize = _ref.fontSize,
6857
+ fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
6858
+ return React__default.createElement(Container$6, {
6859
+ x: x,
6860
+ y: y,
6861
+ fontSize: fontSize
6862
+ }, React__default.createElement("ul", {
6863
+ className: "rpgui-list-imp",
6864
+ style: {
6865
+ overflow: 'hidden'
6866
+ }
6867
+ }, options.map(function (params, index) {
6868
+ return React__default.createElement(ListElement, {
6869
+ key: (params == null ? void 0 : params.id) || index,
6870
+ onClick: function onClick() {
6871
+ onSelected(params == null ? void 0 : params.id);
6872
+ }
6873
+ }, (params == null ? void 0 : params.text) || 'No text');
6874
+ })));
6975
6875
  };
6876
+ var Container$6 = /*#__PURE__*/styled.div.withConfig({
6877
+ displayName: "ListMenu__Container",
6878
+ componentId: "sc-i9097t-0"
6879
+ })(["display:flex;flex-direction:column;width:100%;justify-content:start;align-items:flex-start;position:absolute;top:", "px;left:", "px;li{font-size:", "em;}"], function (props) {
6880
+ return props.y || 0;
6881
+ }, function (props) {
6882
+ return props.x || 0;
6883
+ }, function (props) {
6884
+ return props.fontSize;
6885
+ });
6886
+ var ListElement = /*#__PURE__*/styled.li.withConfig({
6887
+ displayName: "ListMenu__ListElement",
6888
+ componentId: "sc-i9097t-1"
6889
+ })(["margin-right:0.5rem;"]);
6976
6890
 
6977
- var UIStore = /*#__PURE__*/function () {
6978
- function UIStore() {
6979
- var _this = this;
6891
+ var ContainerType;
6980
6892
 
6981
- this.contextMenu = initialState;
6982
- this.onHoverDetail = initialHoverState;
6893
+ (function (ContainerType) {
6894
+ ContainerType["INVENTORY"] = "Inventory";
6895
+ ContainerType["EQUIPMENT_SET"] = "EquipmentSet";
6896
+ })(ContainerType || (ContainerType = {})); // TODO: Refactor this file
6983
6897
 
6984
- this.handleOnItemClick = function (item, posX, posY, slotContainerType) {
6985
- var _this$contextMenu;
6986
6898
 
6987
- if (!item || JSON.stringify((_this$contextMenu = _this.contextMenu) == null ? void 0 : _this$contextMenu.slotItem) === JSON.stringify(item)) {
6988
- _this.clearContextMenu();
6899
+ var generateContextList = function generateContextList(actionsByTypeList) {
6900
+ var contextMenu = actionsByTypeList.map(function (action) {
6901
+ return {
6902
+ id: action,
6903
+ text: shared.ItemSocketEventsDisplayLabels[action]
6904
+ };
6905
+ });
6906
+ return contextMenu;
6907
+ };
6989
6908
 
6990
- _this.clearItemHoverDetail();
6909
+ var handleContextMenuList = function handleContextMenuList(itemType) {
6910
+ var contextActionMenu = [];
6991
6911
 
6992
- return;
6993
- }
6912
+ switch (itemType) {
6913
+ case shared.ItemType.Weapon:
6914
+ case shared.ItemType.Armor:
6915
+ case shared.ItemType.Accessory:
6916
+ case shared.ItemType.Jewelry:
6917
+ case shared.ItemType.Tool:
6918
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
6919
+ break;
6994
6920
 
6995
- switch (slotContainerType) {
6996
- case exports.SlotContainerType.EQUIPMENT_SET:
6997
- _this.setEquipContextMenu({
6998
- visible: true,
6999
- posX: posX,
7000
- posY: posY,
7001
- slotItem: item
6921
+ case shared.ItemType.Consumable:
6922
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Consumable);
6923
+ break;
6924
+
6925
+ case shared.ItemType.CraftMaterial:
6926
+ contextActionMenu = generateContextList(shared.ActionsByItemType.CraftMaterial);
6927
+ break;
6928
+
6929
+ case shared.ItemType.Other:
6930
+ case shared.ItemType.Information:
6931
+ case shared.ItemType.Quest:
6932
+ case shared.ItemType.Container:
6933
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
6934
+ break;
6935
+
6936
+ default:
6937
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
6938
+ break;
6939
+ }
6940
+
6941
+ return contextActionMenu;
6942
+ };
6943
+ var handleEquipmentContextMenuList = function handleEquipmentContextMenuList(itemType) {
6944
+ var contextActionMenu = [];
6945
+
6946
+ switch (itemType) {
6947
+ case shared.ItemType.Weapon:
6948
+ case shared.ItemType.Armor:
6949
+ case shared.ItemType.Accessory:
6950
+ case shared.ItemType.Jewelry:
6951
+ case shared.ItemType.Tool:
6952
+ contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
6953
+ break;
6954
+
6955
+ case shared.ItemType.Container:
6956
+ contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetContainer);
6957
+ break;
6958
+
6959
+ default:
6960
+ contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
6961
+ break;
6962
+ }
6963
+
6964
+ return contextActionMenu;
6965
+ };
6966
+
6967
+ var initialState = {
6968
+ visible: false,
6969
+ posX: 0,
6970
+ posY: 0,
6971
+ contextActions: [],
6972
+ slotItem: null
6973
+ };
6974
+ var initialHoverState = {
6975
+ visible: false,
6976
+ posX: 0,
6977
+ posY: 0,
6978
+ item: null
6979
+ };
6980
+
6981
+ var UIStore = /*#__PURE__*/function () {
6982
+ function UIStore() {
6983
+ var _this = this;
6984
+
6985
+ this.contextMenu = initialState;
6986
+ this.onHoverDetail = initialHoverState;
6987
+
6988
+ this.handleOnItemClick = function (item, posX, posY, slotContainerType) {
6989
+ var _this$contextMenu;
6990
+
6991
+ if (!item || JSON.stringify((_this$contextMenu = _this.contextMenu) == null ? void 0 : _this$contextMenu.slotItem) === JSON.stringify(item)) {
6992
+ _this.clearContextMenu();
6993
+
6994
+ _this.clearItemHoverDetail();
6995
+
6996
+ return;
6997
+ }
6998
+
6999
+ switch (slotContainerType) {
7000
+ case exports.SlotContainerType.EQUIPMENT_SET:
7001
+ _this.setEquipContextMenu({
7002
+ visible: true,
7003
+ posX: posX,
7004
+ posY: posY,
7005
+ slotItem: item
7002
7006
  }, item.type, item.isItemContainer);
7003
7007
 
7004
7008
  break;
@@ -7099,23 +7103,142 @@ var UIStore = /*#__PURE__*/function () {
7099
7103
 
7100
7104
  var uiStore = /*#__PURE__*/new UIStore();
7101
7105
 
7102
- var ItemCard = function ItemCard(_ref) {
7103
- var item = _ref.item,
7104
- x = _ref.x,
7105
- y = _ref.y;
7106
- return React__default.createElement(Container$6, {
7107
- x: x,
7108
- y: y
7109
- }, item == null ? void 0 : item.name);
7110
- };
7111
- var Container$6 = /*#__PURE__*/styled.div.withConfig({
7112
- displayName: "ItemCard__Container",
7113
- componentId: "sc-170rits-0"
7114
- })(["position:absolute;top:", "px;left:", "px;font-size:0.5rem;color:white;background-color:black;border-radius:5px;padding:0.5rem;min-width:20px;opacity:0.5;"], function (props) {
7115
- return props.y || 0;
7116
- }, function (props) {
7117
- return props.x || 0;
7106
+ var EquipmentSet = /*#__PURE__*/mobxReact.observer(function (_ref) {
7107
+ var _uiStore$contextMenu, _uiStore$onHoverDetai;
7108
+
7109
+ var equipmentSet = _ref.equipmentSet,
7110
+ onClose = _ref.onClose,
7111
+ onMouseOver = _ref.onMouseOver,
7112
+ onActionSelected = _ref.onActionSelected,
7113
+ _ref$initialPosition = _ref.initialPosition,
7114
+ initialPosition = _ref$initialPosition === void 0 ? {
7115
+ x: 0,
7116
+ y: 0
7117
+ } : _ref$initialPosition;
7118
+ var neck = equipmentSet.neck,
7119
+ leftHand = equipmentSet.leftHand,
7120
+ ring = equipmentSet.ring,
7121
+ head = equipmentSet.head,
7122
+ armor = equipmentSet.armor,
7123
+ legs = equipmentSet.legs,
7124
+ boot = equipmentSet.boot,
7125
+ inventory = equipmentSet.inventory,
7126
+ rightHand = equipmentSet.rightHand,
7127
+ accessory = equipmentSet.accessory;
7128
+ var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
7129
+ var equipmentMaskSlots = [shared.ItemSlotType.Neck, shared.ItemSlotType.LeftHand, shared.ItemSlotType.Ring, shared.ItemSlotType.Head, shared.ItemSlotType.Torso, shared.ItemSlotType.Legs, shared.ItemSlotType.Feet, shared.ItemSlotType.Inventory, shared.ItemSlotType.RightHand, shared.ItemSlotType.Accessory]; // we use this draggable position to offset the menu position, after the container is dragged (otherwise, it bugs!)
7130
+
7131
+ var _useState = React.useState(initialPosition),
7132
+ draggablePosition = _useState[0],
7133
+ setDraggablePosition = _useState[1];
7134
+
7135
+ var handleOnMouseHover = function handleOnMouseHover(event, slotIndex, item, x, y) {
7136
+ uiStore.handleOnMouseHover(event, slotIndex, item, x, y, onMouseOver);
7137
+ };
7138
+
7139
+ var onSelected = function onSelected(selectedActionId) {
7140
+ uiStore.onSelected(selectedActionId, onActionSelected);
7141
+ };
7142
+
7143
+ var onRenderEquipmentSlotRange = function onRenderEquipmentSlotRange(start, end) {
7144
+ var equipmentRange = equipmentData.slice(start, end);
7145
+ var slotMaksRange = equipmentMaskSlots.slice(start, end);
7146
+ return equipmentRange.map(function (data, i) {
7147
+ var _ref2;
7148
+
7149
+ var item = data;
7150
+ var itemContainer = (_ref2 = item && item.itemContainer) != null ? _ref2 : null;
7151
+ return React__default.createElement(ItemSlot, {
7152
+ key: i,
7153
+ slotIndex: i,
7154
+ item: item,
7155
+ itemContainer: itemContainer,
7156
+ slotContainerType: exports.SlotContainerType.EQUIPMENT_SET,
7157
+ slotSpriteMask: slotMaksRange[i],
7158
+ onMouseOver: handleOnMouseHover,
7159
+ onMouseOut: function onMouseOut() {
7160
+ uiStore.clearItemHoverDetail();
7161
+ },
7162
+ onClick: uiStore.handleOnItemClick,
7163
+ onCancelContextMenu: function onCancelContextMenu() {
7164
+ uiStore.clearContextMenu();
7165
+ }
7166
+ });
7167
+ });
7168
+ };
7169
+
7170
+ return React__default.createElement(DraggableContainer, {
7171
+ title: 'Equipments',
7172
+ type: exports.RPGUIContainerTypes.Framed,
7173
+ onCloseButton: function onCloseButton() {
7174
+ if (onClose) onClose();
7175
+ },
7176
+ width: "330px",
7177
+ cancelDrag: ".equipment-container-body",
7178
+ onPositionChange: function onPositionChange(_ref3) {
7179
+ var x = _ref3.x,
7180
+ y = _ref3.y;
7181
+ setDraggablePosition({
7182
+ x: x,
7183
+ y: y
7184
+ });
7185
+ },
7186
+ onOutsideClick: function onOutsideClick() {
7187
+ uiStore.clearContextMenu();
7188
+ uiStore.clearItemHoverDetail();
7189
+ }
7190
+ }, React__default.createElement(EquipmentSetContainer, {
7191
+ className: "equipment-container-body"
7192
+ }, React__default.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(0, 3)), React__default.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(3, 7)), React__default.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(7, 10))), (_uiStore$contextMenu = uiStore.contextMenu) != null && _uiStore$contextMenu.visible ? React__default.createElement(ListMenu, {
7193
+ x: uiStore.contextMenu.posX - draggablePosition.x,
7194
+ y: uiStore.contextMenu.posY - draggablePosition.y,
7195
+ options: uiStore.contextMenu.contextActions,
7196
+ onSelected: onSelected
7197
+ }) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React__default.createElement(ItemCard, {
7198
+ item: uiStore.onHoverDetail.item,
7199
+ x: uiStore.onHoverDetail.posX - draggablePosition.x,
7200
+ y: uiStore.onHoverDetail.posY - draggablePosition.y
7201
+ }) : null);
7118
7202
  });
7203
+ var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
7204
+ displayName: "EquipmentSet__EquipmentSetContainer",
7205
+ componentId: "sc-1wuddg2-0"
7206
+ })(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;"]);
7207
+ var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
7208
+ displayName: "EquipmentSet__EquipmentColumn",
7209
+ componentId: "sc-1wuddg2-1"
7210
+ })(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
7211
+
7212
+ var SlotsContainer = function SlotsContainer(_ref) {
7213
+ var children = _ref.children,
7214
+ title = _ref.title,
7215
+ onClose = _ref.onClose,
7216
+ _onPositionChange = _ref.onPositionChange,
7217
+ onOutsideClick = _ref.onOutsideClick;
7218
+ return React__default.createElement(DraggableContainer, {
7219
+ title: title,
7220
+ type: exports.RPGUIContainerTypes.Framed,
7221
+ onCloseButton: function onCloseButton() {
7222
+ if (onClose) {
7223
+ onClose();
7224
+ }
7225
+ },
7226
+ width: "330px",
7227
+ cancelDrag: ".item-container-body",
7228
+ onPositionChange: function onPositionChange(_ref2) {
7229
+ var x = _ref2.x,
7230
+ y = _ref2.y;
7231
+
7232
+ if (_onPositionChange) {
7233
+ _onPositionChange({
7234
+ x: x,
7235
+ y: y
7236
+ });
7237
+ }
7238
+ },
7239
+ onOutsideClick: onOutsideClick
7240
+ }, children);
7241
+ };
7119
7242
 
7120
7243
  var ItemContainer = /*#__PURE__*/mobxReact.observer(function (_ref) {
7121
7244
  var _uiStore$contextMenu, _uiStore$onHoverDetai;
@@ -7192,8 +7315,8 @@ var ItemContainer = /*#__PURE__*/mobxReact.observer(function (_ref) {
7192
7315
  onSelected: onSelected
7193
7316
  }) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React__default.createElement(ItemCard, {
7194
7317
  item: uiStore.onHoverDetail.item,
7195
- x: uiStore.onHoverDetail.posX,
7196
- y: uiStore.onHoverDetail.posY
7318
+ x: uiStore.onHoverDetail.posX - draggablePosition.x,
7319
+ y: uiStore.onHoverDetail.posY - draggablePosition.y
7197
7320
  }) : null);
7198
7321
  });
7199
7322
  var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
@@ -7732,25 +7855,371 @@ var Input$1 = /*#__PURE__*/styled.input.withConfig({
7732
7855
  componentId: "sc-v8mte9-0"
7733
7856
  })(["opacity:0;"]);
7734
7857
 
7735
- var SimpleProgressBar = function SimpleProgressBar(_ref) {
7736
- var value = _ref.value,
7737
- _ref$bgColor = _ref.bgColor,
7738
- bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
7739
- _ref$margin = _ref.margin,
7740
- margin = _ref$margin === void 0 ? 20 : _ref$margin;
7741
- return React__default.createElement(Container$b, {
7742
- className: "simple-progress-bar"
7743
- }, React__default.createElement(ProgressBarContainer, {
7744
- margin: margin
7745
- }, React__default.createElement(BackgroundBar, null, React__default.createElement(Progress, {
7746
- value: value,
7747
- bgColor: bgColor
7748
- }))));
7749
- };
7750
- var Container$b = /*#__PURE__*/styled.div.withConfig({
7751
- displayName: "SimpleProgressBar__Container",
7752
- componentId: "sc-mbeil3-0"
7753
- })(["display:flex;justify-content:center;align-items:center;width:100%;"]);
7858
+ var frames$1 = {
7859
+ "metamask-large.png": {
7860
+ frame: {
7861
+ x: 0,
7862
+ y: 0,
7863
+ w: 33,
7864
+ h: 30
7865
+ },
7866
+ rotated: false,
7867
+ trimmed: false,
7868
+ spriteSourceSize: {
7869
+ x: 0,
7870
+ y: 0,
7871
+ w: 33,
7872
+ h: 30
7873
+ },
7874
+ sourceSize: {
7875
+ w: 33,
7876
+ h: 30
7877
+ },
7878
+ pivot: {
7879
+ x: 0.5,
7880
+ y: 0.5
7881
+ }
7882
+ },
7883
+ "chat-large.png": {
7884
+ frame: {
7885
+ x: 0,
7886
+ y: 30,
7887
+ w: 31,
7888
+ h: 29
7889
+ },
7890
+ rotated: false,
7891
+ trimmed: true,
7892
+ spriteSourceSize: {
7893
+ x: 1,
7894
+ y: 3,
7895
+ w: 31,
7896
+ h: 29
7897
+ },
7898
+ sourceSize: {
7899
+ w: 32,
7900
+ h: 32
7901
+ },
7902
+ pivot: {
7903
+ x: 0.5,
7904
+ y: 0.5
7905
+ }
7906
+ },
7907
+ "equipment.png": {
7908
+ frame: {
7909
+ x: 33,
7910
+ y: 0,
7911
+ w: 17,
7912
+ h: 16
7913
+ },
7914
+ rotated: false,
7915
+ trimmed: false,
7916
+ spriteSourceSize: {
7917
+ x: 0,
7918
+ y: 0,
7919
+ w: 17,
7920
+ h: 16
7921
+ },
7922
+ sourceSize: {
7923
+ w: 17,
7924
+ h: 16
7925
+ },
7926
+ pivot: {
7927
+ x: 0.5,
7928
+ y: 0.5
7929
+ }
7930
+ },
7931
+ "inventory.png": {
7932
+ frame: {
7933
+ x: 33,
7934
+ y: 16,
7935
+ w: 17,
7936
+ h: 16
7937
+ },
7938
+ rotated: false,
7939
+ trimmed: false,
7940
+ spriteSourceSize: {
7941
+ x: 0,
7942
+ y: 0,
7943
+ w: 17,
7944
+ h: 16
7945
+ },
7946
+ sourceSize: {
7947
+ w: 17,
7948
+ h: 16
7949
+ },
7950
+ pivot: {
7951
+ x: 0.5,
7952
+ y: 0.5
7953
+ }
7954
+ },
7955
+ "icon-base-blue.png": {
7956
+ frame: {
7957
+ x: 31,
7958
+ y: 32,
7959
+ w: 16,
7960
+ h: 16
7961
+ },
7962
+ rotated: false,
7963
+ trimmed: false,
7964
+ spriteSourceSize: {
7965
+ x: 0,
7966
+ y: 0,
7967
+ w: 16,
7968
+ h: 16
7969
+ },
7970
+ sourceSize: {
7971
+ w: 16,
7972
+ h: 16
7973
+ },
7974
+ pivot: {
7975
+ x: 0.5,
7976
+ y: 0.5
7977
+ }
7978
+ },
7979
+ "icon-base-brown.png": {
7980
+ frame: {
7981
+ x: 50,
7982
+ y: 0,
7983
+ w: 16,
7984
+ h: 16
7985
+ },
7986
+ rotated: false,
7987
+ trimmed: false,
7988
+ spriteSourceSize: {
7989
+ x: 0,
7990
+ y: 0,
7991
+ w: 16,
7992
+ h: 16
7993
+ },
7994
+ sourceSize: {
7995
+ w: 16,
7996
+ h: 16
7997
+ },
7998
+ pivot: {
7999
+ x: 0.5,
8000
+ y: 0.5
8001
+ }
8002
+ },
8003
+ "chat-small.png": {
8004
+ frame: {
8005
+ x: 50,
8006
+ y: 16,
8007
+ w: 16,
8008
+ h: 16
8009
+ },
8010
+ rotated: false,
8011
+ trimmed: true,
8012
+ spriteSourceSize: {
8013
+ x: 1,
8014
+ y: 0,
8015
+ w: 16,
8016
+ h: 16
8017
+ },
8018
+ sourceSize: {
8019
+ w: 17,
8020
+ h: 16
8021
+ },
8022
+ pivot: {
8023
+ x: 0.5,
8024
+ y: 0.5
8025
+ }
8026
+ },
8027
+ "icon-base-gold.png": {
8028
+ frame: {
8029
+ x: 47,
8030
+ y: 32,
8031
+ w: 16,
8032
+ h: 16
8033
+ },
8034
+ rotated: false,
8035
+ trimmed: false,
8036
+ spriteSourceSize: {
8037
+ x: 0,
8038
+ y: 0,
8039
+ w: 16,
8040
+ h: 16
8041
+ },
8042
+ sourceSize: {
8043
+ w: 16,
8044
+ h: 16
8045
+ },
8046
+ pivot: {
8047
+ x: 0.5,
8048
+ y: 0.5
8049
+ }
8050
+ },
8051
+ "equipment-raw.png": {
8052
+ frame: {
8053
+ x: 0,
8054
+ y: 59,
8055
+ w: 15,
8056
+ h: 13
8057
+ },
8058
+ rotated: false,
8059
+ trimmed: true,
8060
+ spriteSourceSize: {
8061
+ x: 0,
8062
+ y: 0,
8063
+ w: 15,
8064
+ h: 13
8065
+ },
8066
+ sourceSize: {
8067
+ w: 16,
8068
+ h: 13
8069
+ },
8070
+ pivot: {
8071
+ x: 0.5,
8072
+ y: 0.5
8073
+ }
8074
+ },
8075
+ "metamask-small.png": {
8076
+ frame: {
8077
+ x: 31,
8078
+ y: 48,
8079
+ w: 15,
8080
+ h: 15
8081
+ },
8082
+ rotated: false,
8083
+ trimmed: true,
8084
+ spriteSourceSize: {
8085
+ x: 1,
8086
+ y: 0,
8087
+ w: 15,
8088
+ h: 15
8089
+ },
8090
+ sourceSize: {
8091
+ w: 16,
8092
+ h: 16
8093
+ },
8094
+ pivot: {
8095
+ x: 0.5,
8096
+ y: 0.5
8097
+ }
8098
+ },
8099
+ "settings.png": {
8100
+ frame: {
8101
+ x: 46,
8102
+ y: 48,
8103
+ w: 14,
8104
+ h: 14
8105
+ },
8106
+ rotated: false,
8107
+ trimmed: true,
8108
+ spriteSourceSize: {
8109
+ x: 1,
8110
+ y: 1,
8111
+ w: 14,
8112
+ h: 14
8113
+ },
8114
+ sourceSize: {
8115
+ w: 16,
8116
+ h: 16
8117
+ },
8118
+ pivot: {
8119
+ x: 0.5,
8120
+ y: 0.5
8121
+ }
8122
+ },
8123
+ "inventory-raw.png": {
8124
+ frame: {
8125
+ x: 15,
8126
+ y: 59,
8127
+ w: 13,
8128
+ h: 13
8129
+ },
8130
+ rotated: false,
8131
+ trimmed: true,
8132
+ spriteSourceSize: {
8133
+ x: 1,
8134
+ y: 2,
8135
+ w: 13,
8136
+ h: 13
8137
+ },
8138
+ sourceSize: {
8139
+ w: 16,
8140
+ h: 16
8141
+ },
8142
+ pivot: {
8143
+ x: 0.5,
8144
+ y: 0.5
8145
+ }
8146
+ }
8147
+ };
8148
+ var meta$1 = {
8149
+ app: "http://free-tex-packer.com",
8150
+ version: "0.6.7",
8151
+ image: "icons.png",
8152
+ format: "RGBA8888",
8153
+ size: {
8154
+ w: 66,
8155
+ h: 72
8156
+ },
8157
+ scale: 1
8158
+ };
8159
+ var iconsAtlasJSON = {
8160
+ frames: frames$1,
8161
+ meta: meta$1
8162
+ };
8163
+
8164
+ var img$3 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAABICAMAAAB1EdO8AAAAkFBMVEUAAADtgCT////1hB92PhridiXX19dVPioVFRXQt0W2nSuIdWScgxFuW0mpfFInt+iGmqJ7UTEUpNXEmWxUanQBZolmZmLj+P/MYiguIhhtZWVOMRxNLRWWlpG7vrq6vbmoqKjArJ3VwLQWFhZ7eXl6ZlTq7OzutCkhM0eqfVHBrZ6/q5z/5HjKYSj83SDxgSCOHfTqAAAAAnRSTlMADpEr4D8AAAN0SURBVFjDrdcBW9owEAbgGyNtF2m1CDhBtDIR1Dn//7/b3TXtl6SUtTz7HmlusrxPEgqcRN+oP/rsLAxRGoQkU2PoVIyZEgs/wszSqyCpCFM2zAnA8DNM2B+r1UomyyhEHhIiwIgECRN2tX1aifC0rYm8Q6gRIkYEEE9iyNUReUTA+N5EBRcm1KgFR+Qe4QQYEEA4QwVH5D6BgHAACLcXj8hjAgYEEBsWamMDIgfhxxHTkNiUG3cWXIHIGyI0lAh+Q7KKggXZS4FVSEB0NxITZbGxIpUgNB3CNIRvkG6Ef9wgBFIT1AIggBDNZLrVVVhhhEBAyERHoHIET0XcKhAlSKZ1CQ3RsDc75pmoVCKNp2RBvEX8lGipVbuM9CpMmlWJlyoDYZqJdQGCj6yUpOn9vRJJMmmTJJkIzvg6Hh1xPH6pIGEiLwuNGEpMvIBoHH1oQOzL4va2uK2NLgEhJJCUhTogXqqJewwn/vwOiZeJewhhJHqWnwbSp56oJt3vy/JwkPPs2YhneB85ECjd80kcDrd8HP8gjEza/ZLs9B8+wekhkoAwu11N8GjOEZXOxa0F48MjPlqhS1AmQnCDN/+X3p93zxy+vnu/TvOiUKAAwQIFwZfQc53gibS5OfUWvxIiFrJzUSIvJSrkuRCxUCX9qdTofD6EApOcyakknIyWQeIPIEdM+pNky+s7L9fLWdRsDCHurr3cLWf2AmIeEfYCYh4R9gJiHhF2NMGJCHuCSNbrdXcEMY8I2yVeqqRa87gORxDziLBdIpkkOjUaQcwjwo5chSYi7Miz0ESEHfWKuESEHU4gEWEHEvPobWb9DCD+y5udpmjNzdQViwUhAwgxnDCtpy9ubhZgQPR8akUNrU5vHi2BL5ZuKiHUUEGJNiAyFqqsJ9Q2xXVBaiwWENTQrybqSdsUG6OE7uD1VfcSEtQbXoEQepF9iED0qsVAgqR9Y0JaOeojzguygKORB1fUs5HzgoaJugiPEwYNJ7ovqob/gPXHtk1t/tpsG1qucWuFxPZxJcPjVga0qTB20reIcPIG17li6FUJtKk10XYdQnTeZjAg1AHhWpemRrqGChS0qTQsMEiDNnUE8cCCGlxR0KYOFsoHdxZcERrEUat4c6/I2wNdSpQ8V6QSxOiN8E8zBG3qcIEvUmjttakj9hHWpWSU8BfjYZgnq0kqDAAAAABJRU5ErkJggg==';
8165
+
8166
+ var SpriteIcon = function SpriteIcon(_ref) {
8167
+ var onClick = _ref.onClick,
8168
+ spriteKey = _ref.spriteKey,
8169
+ baseSpriteKey = _ref.baseSpriteKey,
8170
+ imgStyle = _ref.imgStyle;
8171
+ return React__default.createElement(Container$b, null, baseSpriteKey && React__default.createElement(Slot, null, React__default.createElement(SpriteFromAtlas, {
8172
+ onClick: onClick,
8173
+ atlasJSON: iconsAtlasJSON,
8174
+ atlasIMG: img$3,
8175
+ spriteKey: baseSpriteKey,
8176
+ width: 32,
8177
+ height: 32,
8178
+ containerStyle: {
8179
+ zIndex: -1
8180
+ }
8181
+ })), React__default.createElement(Slot, null, React__default.createElement(SpriteFromAtlas, {
8182
+ onClick: onClick,
8183
+ atlasJSON: iconsAtlasJSON,
8184
+ atlasIMG: img$3,
8185
+ spriteKey: spriteKey,
8186
+ width: 28,
8187
+ height: 28,
8188
+ containerStyle: {
8189
+ zIndex: 0
8190
+ },
8191
+ imgScale: baseSpriteKey ? 1.5 : 2,
8192
+ imgStyle: imgStyle
8193
+ })));
8194
+ };
8195
+ var Container$b = /*#__PURE__*/styled.div.withConfig({
8196
+ displayName: "SpriteIcon__Container",
8197
+ componentId: "sc-vi5t1x-0"
8198
+ })(["position:relative;width:32px;height:32px;display:flex;justify-content:center;align-items:center;"]);
8199
+ var Slot = /*#__PURE__*/styled.div.withConfig({
8200
+ displayName: "SpriteIcon__Slot",
8201
+ componentId: "sc-vi5t1x-1"
8202
+ })(["position:absolute;"]);
8203
+
8204
+ var SimpleProgressBar = function SimpleProgressBar(_ref) {
8205
+ var value = _ref.value,
8206
+ _ref$bgColor = _ref.bgColor,
8207
+ bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
8208
+ _ref$margin = _ref.margin,
8209
+ margin = _ref$margin === void 0 ? 20 : _ref$margin;
8210
+ return React__default.createElement(Container$c, {
8211
+ className: "simple-progress-bar"
8212
+ }, React__default.createElement(ProgressBarContainer, {
8213
+ margin: margin
8214
+ }, React__default.createElement(BackgroundBar, null, React__default.createElement(Progress, {
8215
+ value: value,
8216
+ bgColor: bgColor
8217
+ }))));
8218
+ };
8219
+ var Container$c = /*#__PURE__*/styled.div.withConfig({
8220
+ displayName: "SimpleProgressBar__Container",
8221
+ componentId: "sc-mbeil3-0"
8222
+ })(["display:flex;justify-content:center;align-items:center;width:100%;"]);
7754
8223
  var BackgroundBar = /*#__PURE__*/styled.span.withConfig({
7755
8224
  displayName: "SimpleProgressBar__BackgroundBar",
7756
8225
  componentId: "sc-mbeil3-1"
@@ -7784,7 +8253,7 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
7784
8253
  atlasIMG: img,
7785
8254
  atlasJSON: atlasJSON,
7786
8255
  spriteKey: texturePath,
7787
- scale: 1,
8256
+ imgScale: 1,
7788
8257
  grayScale: true,
7789
8258
  opacity: 0.5
7790
8259
  })) : React__default.createElement(React__default.Fragment, null)), React__default.createElement(ProgressBarContainer$1, null, React__default.createElement(SimpleProgressBar, {
@@ -7840,123 +8309,17 @@ var Truncate = function Truncate(_ref) {
7840
8309
  var _ref$maxLines = _ref.maxLines,
7841
8310
  maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
7842
8311
  children = _ref.children;
7843
- return React__default.createElement(Container$c, {
8312
+ return React__default.createElement(Container$d, {
7844
8313
  maxLines: maxLines
7845
8314
  }, children);
7846
8315
  };
7847
- var Container$c = /*#__PURE__*/styled.div.withConfig({
8316
+ var Container$d = /*#__PURE__*/styled.div.withConfig({
7848
8317
  displayName: "Truncate__Container",
7849
8318
  componentId: "sc-6x00qb-0"
7850
8319
  })(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
7851
8320
  return props.maxLines;
7852
8321
  });
7853
8322
 
7854
- var EquipmentSet = /*#__PURE__*/mobxReact.observer(function (_ref) {
7855
- var _uiStore$contextMenu, _uiStore$onHoverDetai;
7856
-
7857
- var equipmentSet = _ref.equipmentSet,
7858
- onClose = _ref.onClose,
7859
- onMouseOver = _ref.onMouseOver,
7860
- onActionSelected = _ref.onActionSelected,
7861
- _ref$initialPosition = _ref.initialPosition,
7862
- initialPosition = _ref$initialPosition === void 0 ? {
7863
- x: 0,
7864
- y: 0
7865
- } : _ref$initialPosition;
7866
- var neck = equipmentSet.neck,
7867
- leftHand = equipmentSet.leftHand,
7868
- ring = equipmentSet.ring,
7869
- head = equipmentSet.head,
7870
- armor = equipmentSet.armor,
7871
- legs = equipmentSet.legs,
7872
- boot = equipmentSet.boot,
7873
- inventory = equipmentSet.inventory,
7874
- rightHand = equipmentSet.rightHand,
7875
- accessory = equipmentSet.accessory;
7876
- var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
7877
- var equipmentMaskSlots = [shared.ItemSlotType.Neck, shared.ItemSlotType.LeftHand, shared.ItemSlotType.Ring, shared.ItemSlotType.Head, shared.ItemSlotType.Torso, shared.ItemSlotType.Legs, shared.ItemSlotType.Feet, shared.ItemSlotType.Inventory, shared.ItemSlotType.RightHand, shared.ItemSlotType.Accessory]; // we use this draggable position to offset the menu position, after the container is dragged (otherwise, it bugs!)
7878
-
7879
- var _useState = React.useState(initialPosition),
7880
- draggablePosition = _useState[0],
7881
- setDraggablePosition = _useState[1];
7882
-
7883
- var handleOnMouseHover = function handleOnMouseHover(event, slotIndex, item, x, y) {
7884
- uiStore.handleOnMouseHover(event, slotIndex, item, x, y, onMouseOver);
7885
- };
7886
-
7887
- var onSelected = function onSelected(selectedActionId) {
7888
- uiStore.onSelected(selectedActionId, onActionSelected);
7889
- };
7890
-
7891
- var onRenderEquipmentSlotRange = function onRenderEquipmentSlotRange(start, end) {
7892
- var equipmentRange = equipmentData.slice(start, end);
7893
- var slotMaksRange = equipmentMaskSlots.slice(start, end);
7894
- return equipmentRange.map(function (data, i) {
7895
- var _ref2;
7896
-
7897
- var item = data;
7898
- var itemContainer = (_ref2 = item && item.itemContainer) != null ? _ref2 : null;
7899
- return React__default.createElement(ItemSlot, {
7900
- key: i,
7901
- slotIndex: i,
7902
- item: item,
7903
- itemContainer: itemContainer,
7904
- slotContainerType: exports.SlotContainerType.EQUIPMENT_SET,
7905
- slotSpriteMask: slotMaksRange[i],
7906
- onMouseOver: handleOnMouseHover,
7907
- onMouseOut: function onMouseOut() {
7908
- uiStore.clearItemHoverDetail();
7909
- },
7910
- onClick: uiStore.handleOnItemClick,
7911
- onCancelContextMenu: function onCancelContextMenu() {
7912
- uiStore.clearContextMenu();
7913
- }
7914
- });
7915
- });
7916
- };
7917
-
7918
- return React__default.createElement(DraggableContainer, {
7919
- title: 'Equipments',
7920
- type: exports.RPGUIContainerTypes.Framed,
7921
- onCloseButton: function onCloseButton() {
7922
- if (onClose) onClose();
7923
- },
7924
- width: "330px",
7925
- cancelDrag: ".equipment-container-body",
7926
- onPositionChange: function onPositionChange(_ref3) {
7927
- var x = _ref3.x,
7928
- y = _ref3.y;
7929
- setDraggablePosition({
7930
- x: x,
7931
- y: y
7932
- });
7933
- },
7934
- onOutsideClick: function onOutsideClick() {
7935
- uiStore.clearContextMenu();
7936
- uiStore.clearItemHoverDetail();
7937
- }
7938
- }, React__default.createElement(EquipmentSetContainer, {
7939
- className: "equipment-container-body"
7940
- }, React__default.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(0, 3)), React__default.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(3, 7)), React__default.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(7, 10))), (_uiStore$contextMenu = uiStore.contextMenu) != null && _uiStore$contextMenu.visible ? React__default.createElement(ListMenu, {
7941
- x: uiStore.contextMenu.posX - draggablePosition.x,
7942
- y: uiStore.contextMenu.posY - draggablePosition.y,
7943
- options: uiStore.contextMenu.contextActions,
7944
- onSelected: onSelected
7945
- }) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React__default.createElement(ItemCard, {
7946
- item: uiStore.onHoverDetail.item,
7947
- x: uiStore.onHoverDetail.posX - draggablePosition.x,
7948
- y: uiStore.onHoverDetail.posY - draggablePosition.y
7949
- }) : null);
7950
- });
7951
- var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
7952
- displayName: "EquipmentSet__EquipmentSetContainer",
7953
- componentId: "sc-1wuddg2-0"
7954
- })(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;"]);
7955
- var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
7956
- displayName: "EquipmentSet__EquipmentColumn",
7957
- componentId: "sc-1wuddg2-1"
7958
- })(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
7959
-
7960
8323
  exports.Button = Button;
7961
8324
  exports.Chat = Chat;
7962
8325
  exports.CheckButton = CheckButton;
@@ -7977,6 +8340,7 @@ exports.RPGUIRoot = RPGUIRoot;
7977
8340
  exports.RangeSlider = RangeSlider;
7978
8341
  exports.SkillProgressBar = SkillProgressBar;
7979
8342
  exports.SpriteFromAtlas = SpriteFromAtlas;
8343
+ exports.SpriteIcon = SpriteIcon;
7980
8344
  exports.TextArea = TextArea;
7981
8345
  exports.Truncate = Truncate;
7982
8346
  exports._RPGUI = _RPGUI;