@rpg-engine/long-bow 0.1.71 → 0.1.72
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.
- package/dist/components/{Item → shared}/SpriteFromAtlas.d.ts +4 -1
- package/dist/components/shared/SpriteIcon.d.ts +9 -0
- package/dist/index.d.ts +3 -2
- package/dist/long-bow.cjs.development.js +685 -332
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +690 -338
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemContainer.tsx +2 -2
- package/src/components/Item/Inventory/ItemSlot.tsx +4 -4
- package/src/components/ListMenu.tsx +2 -2
- package/src/components/Multitab/TabsContainer.tsx +2 -0
- package/src/components/SkillProgressBar.tsx +2 -2
- package/src/components/{Item → shared}/SpriteFromAtlas.tsx +17 -4
- package/src/components/shared/SpriteIcon.tsx +67 -0
- package/src/index.tsx +3 -2
- package/src/mocks/atlas/icons/icons.json +303 -0
- package/src/mocks/atlas/icons/icons.png +0 -0
|
@@ -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() {
|
|
@@ -456,152 +456,23 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
456
456
|
}));
|
|
457
457
|
};
|
|
458
458
|
|
|
459
|
-
var
|
|
460
|
-
var
|
|
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,
|
|
459
|
+
var ItemCard = function ItemCard(_ref) {
|
|
460
|
+
var item = _ref.item,
|
|
493
461
|
x = _ref.x,
|
|
494
|
-
y = _ref.y
|
|
495
|
-
_ref$fontSize = _ref.fontSize,
|
|
496
|
-
fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
|
|
462
|
+
y = _ref.y;
|
|
497
463
|
return React__default.createElement(Container$3, {
|
|
498
464
|
x: x,
|
|
499
|
-
y: y
|
|
500
|
-
|
|
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
|
-
})));
|
|
465
|
+
y: y
|
|
466
|
+
}, item == null ? void 0 : item.name);
|
|
514
467
|
};
|
|
515
468
|
var Container$3 = /*#__PURE__*/styled.div.withConfig({
|
|
516
|
-
displayName: "
|
|
517
|
-
componentId: "sc-
|
|
518
|
-
})(["
|
|
469
|
+
displayName: "ItemCard__Container",
|
|
470
|
+
componentId: "sc-170rits-0"
|
|
471
|
+
})(["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
472
|
return props.y || 0;
|
|
520
473
|
}, function (props) {
|
|
521
474
|
return props.x || 0;
|
|
522
|
-
}, function (props) {
|
|
523
|
-
return props.fontSize;
|
|
524
475
|
});
|
|
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
476
|
|
|
606
477
|
var frames = {
|
|
607
478
|
"helmets/berserkers-helmet.png": {
|
|
@@ -6799,8 +6670,11 @@ var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
|
|
|
6799
6670
|
width = _ref$width === void 0 ? shared.GRID_WIDTH : _ref$width,
|
|
6800
6671
|
_ref$height = _ref.height,
|
|
6801
6672
|
height = _ref$height === void 0 ? shared.GRID_HEIGHT : _ref$height,
|
|
6802
|
-
_ref$
|
|
6803
|
-
|
|
6673
|
+
_ref$imgScale = _ref.imgScale,
|
|
6674
|
+
imgScale = _ref$imgScale === void 0 ? 2 : _ref$imgScale,
|
|
6675
|
+
imgStyle = _ref.imgStyle,
|
|
6676
|
+
onClick = _ref.onClick,
|
|
6677
|
+
containerStyle = _ref.containerStyle,
|
|
6804
6678
|
_ref$grayScale = _ref.grayScale,
|
|
6805
6679
|
grayScale = _ref$grayScale === void 0 ? false : _ref$grayScale,
|
|
6806
6680
|
_ref$opacity = _ref.opacity,
|
|
@@ -6811,19 +6685,22 @@ var SpriteFromAtlas = function SpriteFromAtlas(_ref) {
|
|
|
6811
6685
|
return React__default.createElement(Container$4, {
|
|
6812
6686
|
width: width,
|
|
6813
6687
|
height: height,
|
|
6814
|
-
hasHover: grayScale
|
|
6688
|
+
hasHover: grayScale,
|
|
6689
|
+
onClick: onClick,
|
|
6690
|
+
style: containerStyle
|
|
6815
6691
|
}, React__default.createElement(ImgSprite, {
|
|
6816
6692
|
className: "sprite-from-atlas-img",
|
|
6817
6693
|
atlasIMG: atlasIMG,
|
|
6818
6694
|
frame: spriteData.frame,
|
|
6819
|
-
scale:
|
|
6695
|
+
scale: imgScale,
|
|
6820
6696
|
grayScale: grayScale,
|
|
6821
|
-
opacity: opacity
|
|
6697
|
+
opacity: opacity,
|
|
6698
|
+
style: imgStyle
|
|
6822
6699
|
}));
|
|
6823
6700
|
};
|
|
6824
6701
|
var Container$4 = /*#__PURE__*/styled.div.withConfig({
|
|
6825
6702
|
displayName: "SpriteFromAtlas__Container",
|
|
6826
|
-
componentId: "sc-
|
|
6703
|
+
componentId: "sc-1lpani8-0"
|
|
6827
6704
|
})(["width:", "px;height:", "px;", ""], function (props) {
|
|
6828
6705
|
return props.width;
|
|
6829
6706
|
}, function (props) {
|
|
@@ -6833,7 +6710,7 @@ var Container$4 = /*#__PURE__*/styled.div.withConfig({
|
|
|
6833
6710
|
});
|
|
6834
6711
|
var ImgSprite = /*#__PURE__*/styled.div.withConfig({
|
|
6835
6712
|
displayName: "SpriteFromAtlas__ImgSprite",
|
|
6836
|
-
componentId: "sc-
|
|
6713
|
+
componentId: "sc-1lpani8-1"
|
|
6837
6714
|
})(["width:", "px;height:", "px;background-image:url(", ");background-position:-", "px -", "px;transform:scale(", ");position:relative;top:8px;left:8px;filter:", ";opacity:", ";"], function (props) {
|
|
6838
6715
|
return props.frame.w;
|
|
6839
6716
|
}, function (props) {
|
|
@@ -6892,7 +6769,7 @@ var ItemSlot = function ItemSlot(_ref) {
|
|
|
6892
6769
|
atlasIMG: img,
|
|
6893
6770
|
atlasJSON: atlasJSON,
|
|
6894
6771
|
spriteKey: itemToRender.texturePath,
|
|
6895
|
-
|
|
6772
|
+
imgScale: 3
|
|
6896
6773
|
}));
|
|
6897
6774
|
}
|
|
6898
6775
|
|
|
@@ -6913,14 +6790,14 @@ var ItemSlot = function ItemSlot(_ref) {
|
|
|
6913
6790
|
atlasIMG: img,
|
|
6914
6791
|
atlasJSON: atlasJSON,
|
|
6915
6792
|
spriteKey: itemToRender.texturePath,
|
|
6916
|
-
|
|
6793
|
+
imgScale: 3
|
|
6917
6794
|
});
|
|
6918
6795
|
} else {
|
|
6919
6796
|
return React__default.createElement(SpriteFromAtlas, {
|
|
6920
6797
|
atlasIMG: img,
|
|
6921
6798
|
atlasJSON: atlasJSON,
|
|
6922
6799
|
spriteKey: EquipmentSlotSpriteByType[slotSpriteMask],
|
|
6923
|
-
|
|
6800
|
+
imgScale: 3,
|
|
6924
6801
|
grayScale: true,
|
|
6925
6802
|
opacity: 0.4
|
|
6926
6803
|
});
|
|
@@ -6960,60 +6837,176 @@ var ItemQty = /*#__PURE__*/styled.span.withConfig({
|
|
|
6960
6837
|
return props.left;
|
|
6961
6838
|
});
|
|
6962
6839
|
|
|
6963
|
-
var
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6840
|
+
var ListMenu = function ListMenu(_ref) {
|
|
6841
|
+
var options = _ref.options,
|
|
6842
|
+
onSelected = _ref.onSelected,
|
|
6843
|
+
x = _ref.x,
|
|
6844
|
+
y = _ref.y,
|
|
6845
|
+
_ref$fontSize = _ref.fontSize,
|
|
6846
|
+
fontSize = _ref$fontSize === void 0 ? 0.8 : _ref$fontSize;
|
|
6847
|
+
return React__default.createElement(Container$6, {
|
|
6848
|
+
x: x,
|
|
6849
|
+
y: y,
|
|
6850
|
+
fontSize: fontSize
|
|
6851
|
+
}, React__default.createElement("ul", {
|
|
6852
|
+
className: "rpgui-list-imp",
|
|
6853
|
+
style: {
|
|
6854
|
+
overflow: 'hidden'
|
|
6855
|
+
}
|
|
6856
|
+
}, options.map(function (params, index) {
|
|
6857
|
+
return React__default.createElement(ListElement, {
|
|
6858
|
+
key: (params == null ? void 0 : params.id) || index,
|
|
6859
|
+
onClick: function onClick() {
|
|
6860
|
+
onSelected(params == null ? void 0 : params.id);
|
|
6861
|
+
}
|
|
6862
|
+
}, (params == null ? void 0 : params.text) || 'No text');
|
|
6863
|
+
})));
|
|
6975
6864
|
};
|
|
6865
|
+
var Container$6 = /*#__PURE__*/styled.div.withConfig({
|
|
6866
|
+
displayName: "ListMenu__Container",
|
|
6867
|
+
componentId: "sc-i9097t-0"
|
|
6868
|
+
})(["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) {
|
|
6869
|
+
return props.y || 0;
|
|
6870
|
+
}, function (props) {
|
|
6871
|
+
return props.x || 0;
|
|
6872
|
+
}, function (props) {
|
|
6873
|
+
return props.fontSize;
|
|
6874
|
+
});
|
|
6875
|
+
var ListElement = /*#__PURE__*/styled.li.withConfig({
|
|
6876
|
+
displayName: "ListMenu__ListElement",
|
|
6877
|
+
componentId: "sc-i9097t-1"
|
|
6878
|
+
})(["margin-right:0.5rem;"]);
|
|
6976
6879
|
|
|
6977
|
-
var
|
|
6978
|
-
function UIStore() {
|
|
6979
|
-
var _this = this;
|
|
6980
|
-
|
|
6981
|
-
this.contextMenu = initialState;
|
|
6982
|
-
this.onHoverDetail = initialHoverState;
|
|
6983
|
-
|
|
6984
|
-
this.handleOnItemClick = function (item, posX, posY, slotContainerType) {
|
|
6985
|
-
var _this$contextMenu;
|
|
6880
|
+
var ContainerType;
|
|
6986
6881
|
|
|
6987
|
-
|
|
6988
|
-
|
|
6882
|
+
(function (ContainerType) {
|
|
6883
|
+
ContainerType["INVENTORY"] = "Inventory";
|
|
6884
|
+
ContainerType["EQUIPMENT_SET"] = "EquipmentSet";
|
|
6885
|
+
})(ContainerType || (ContainerType = {})); // TODO: Refactor this file
|
|
6989
6886
|
|
|
6990
|
-
_this.clearItemHoverDetail();
|
|
6991
6887
|
|
|
6992
|
-
|
|
6993
|
-
|
|
6888
|
+
var generateContextList = function generateContextList(actionsByTypeList) {
|
|
6889
|
+
var contextMenu = actionsByTypeList.map(function (action) {
|
|
6890
|
+
return {
|
|
6891
|
+
id: action,
|
|
6892
|
+
text: shared.ItemSocketEventsDisplayLabels[action]
|
|
6893
|
+
};
|
|
6894
|
+
});
|
|
6895
|
+
return contextMenu;
|
|
6896
|
+
};
|
|
6994
6897
|
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
_this.setEquipContextMenu({
|
|
6998
|
-
visible: true,
|
|
6999
|
-
posX: posX,
|
|
7000
|
-
posY: posY,
|
|
7001
|
-
slotItem: item
|
|
7002
|
-
}, item.type, item.isItemContainer);
|
|
6898
|
+
var handleContextMenuList = function handleContextMenuList(itemType) {
|
|
6899
|
+
var contextActionMenu = [];
|
|
7003
6900
|
|
|
7004
|
-
|
|
6901
|
+
switch (itemType) {
|
|
6902
|
+
case shared.ItemType.Weapon:
|
|
6903
|
+
case shared.ItemType.Armor:
|
|
6904
|
+
case shared.ItemType.Accessory:
|
|
6905
|
+
case shared.ItemType.Jewelry:
|
|
6906
|
+
case shared.ItemType.Tool:
|
|
6907
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
|
|
6908
|
+
break;
|
|
7005
6909
|
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
posX: posX,
|
|
7010
|
-
posY: posY,
|
|
7011
|
-
slotItem: item
|
|
7012
|
-
}, item.type);
|
|
6910
|
+
case shared.ItemType.Consumable:
|
|
6911
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.Consumable);
|
|
6912
|
+
break;
|
|
7013
6913
|
|
|
7014
|
-
|
|
6914
|
+
case shared.ItemType.CraftMaterial:
|
|
6915
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.CraftMaterial);
|
|
6916
|
+
break;
|
|
7015
6917
|
|
|
7016
|
-
|
|
6918
|
+
case shared.ItemType.Other:
|
|
6919
|
+
case shared.ItemType.Information:
|
|
6920
|
+
case shared.ItemType.Quest:
|
|
6921
|
+
case shared.ItemType.Container:
|
|
6922
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
|
|
6923
|
+
break;
|
|
6924
|
+
|
|
6925
|
+
default:
|
|
6926
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
|
|
6927
|
+
break;
|
|
6928
|
+
}
|
|
6929
|
+
|
|
6930
|
+
return contextActionMenu;
|
|
6931
|
+
};
|
|
6932
|
+
var handleEquipmentContextMenuList = function handleEquipmentContextMenuList(itemType) {
|
|
6933
|
+
var contextActionMenu = [];
|
|
6934
|
+
|
|
6935
|
+
switch (itemType) {
|
|
6936
|
+
case shared.ItemType.Weapon:
|
|
6937
|
+
case shared.ItemType.Armor:
|
|
6938
|
+
case shared.ItemType.Accessory:
|
|
6939
|
+
case shared.ItemType.Jewelry:
|
|
6940
|
+
case shared.ItemType.Tool:
|
|
6941
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
|
|
6942
|
+
break;
|
|
6943
|
+
|
|
6944
|
+
case shared.ItemType.Container:
|
|
6945
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetContainer);
|
|
6946
|
+
break;
|
|
6947
|
+
|
|
6948
|
+
default:
|
|
6949
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
|
|
6950
|
+
break;
|
|
6951
|
+
}
|
|
6952
|
+
|
|
6953
|
+
return contextActionMenu;
|
|
6954
|
+
};
|
|
6955
|
+
|
|
6956
|
+
var initialState = {
|
|
6957
|
+
visible: false,
|
|
6958
|
+
posX: 0,
|
|
6959
|
+
posY: 0,
|
|
6960
|
+
contextActions: [],
|
|
6961
|
+
slotItem: null
|
|
6962
|
+
};
|
|
6963
|
+
var initialHoverState = {
|
|
6964
|
+
visible: false,
|
|
6965
|
+
posX: 0,
|
|
6966
|
+
posY: 0,
|
|
6967
|
+
item: null
|
|
6968
|
+
};
|
|
6969
|
+
|
|
6970
|
+
var UIStore = /*#__PURE__*/function () {
|
|
6971
|
+
function UIStore() {
|
|
6972
|
+
var _this = this;
|
|
6973
|
+
|
|
6974
|
+
this.contextMenu = initialState;
|
|
6975
|
+
this.onHoverDetail = initialHoverState;
|
|
6976
|
+
|
|
6977
|
+
this.handleOnItemClick = function (item, posX, posY, slotContainerType) {
|
|
6978
|
+
var _this$contextMenu;
|
|
6979
|
+
|
|
6980
|
+
if (!item || JSON.stringify((_this$contextMenu = _this.contextMenu) == null ? void 0 : _this$contextMenu.slotItem) === JSON.stringify(item)) {
|
|
6981
|
+
_this.clearContextMenu();
|
|
6982
|
+
|
|
6983
|
+
_this.clearItemHoverDetail();
|
|
6984
|
+
|
|
6985
|
+
return;
|
|
6986
|
+
}
|
|
6987
|
+
|
|
6988
|
+
switch (slotContainerType) {
|
|
6989
|
+
case exports.SlotContainerType.EQUIPMENT_SET:
|
|
6990
|
+
_this.setEquipContextMenu({
|
|
6991
|
+
visible: true,
|
|
6992
|
+
posX: posX,
|
|
6993
|
+
posY: posY,
|
|
6994
|
+
slotItem: item
|
|
6995
|
+
}, item.type, item.isItemContainer);
|
|
6996
|
+
|
|
6997
|
+
break;
|
|
6998
|
+
|
|
6999
|
+
case exports.SlotContainerType.INVENTORY:
|
|
7000
|
+
_this.setContextMenu({
|
|
7001
|
+
visible: true,
|
|
7002
|
+
posX: posX,
|
|
7003
|
+
posY: posY,
|
|
7004
|
+
slotItem: item
|
|
7005
|
+
}, item.type);
|
|
7006
|
+
|
|
7007
|
+
break;
|
|
7008
|
+
|
|
7009
|
+
default:
|
|
7017
7010
|
_this.setContextMenu({
|
|
7018
7011
|
visible: true,
|
|
7019
7012
|
posX: posX,
|
|
@@ -7099,23 +7092,142 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
7099
7092
|
|
|
7100
7093
|
var uiStore = /*#__PURE__*/new UIStore();
|
|
7101
7094
|
|
|
7102
|
-
var
|
|
7103
|
-
var
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7095
|
+
var EquipmentSet = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
7096
|
+
var _uiStore$contextMenu, _uiStore$onHoverDetai;
|
|
7097
|
+
|
|
7098
|
+
var equipmentSet = _ref.equipmentSet,
|
|
7099
|
+
onClose = _ref.onClose,
|
|
7100
|
+
onMouseOver = _ref.onMouseOver,
|
|
7101
|
+
onActionSelected = _ref.onActionSelected,
|
|
7102
|
+
_ref$initialPosition = _ref.initialPosition,
|
|
7103
|
+
initialPosition = _ref$initialPosition === void 0 ? {
|
|
7104
|
+
x: 0,
|
|
7105
|
+
y: 0
|
|
7106
|
+
} : _ref$initialPosition;
|
|
7107
|
+
var neck = equipmentSet.neck,
|
|
7108
|
+
leftHand = equipmentSet.leftHand,
|
|
7109
|
+
ring = equipmentSet.ring,
|
|
7110
|
+
head = equipmentSet.head,
|
|
7111
|
+
armor = equipmentSet.armor,
|
|
7112
|
+
legs = equipmentSet.legs,
|
|
7113
|
+
boot = equipmentSet.boot,
|
|
7114
|
+
inventory = equipmentSet.inventory,
|
|
7115
|
+
rightHand = equipmentSet.rightHand,
|
|
7116
|
+
accessory = equipmentSet.accessory;
|
|
7117
|
+
var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
|
|
7118
|
+
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!)
|
|
7119
|
+
|
|
7120
|
+
var _useState = React.useState(initialPosition),
|
|
7121
|
+
draggablePosition = _useState[0],
|
|
7122
|
+
setDraggablePosition = _useState[1];
|
|
7123
|
+
|
|
7124
|
+
var handleOnMouseHover = function handleOnMouseHover(event, slotIndex, item, x, y) {
|
|
7125
|
+
uiStore.handleOnMouseHover(event, slotIndex, item, x, y, onMouseOver);
|
|
7126
|
+
};
|
|
7127
|
+
|
|
7128
|
+
var onSelected = function onSelected(selectedActionId) {
|
|
7129
|
+
uiStore.onSelected(selectedActionId, onActionSelected);
|
|
7130
|
+
};
|
|
7131
|
+
|
|
7132
|
+
var onRenderEquipmentSlotRange = function onRenderEquipmentSlotRange(start, end) {
|
|
7133
|
+
var equipmentRange = equipmentData.slice(start, end);
|
|
7134
|
+
var slotMaksRange = equipmentMaskSlots.slice(start, end);
|
|
7135
|
+
return equipmentRange.map(function (data, i) {
|
|
7136
|
+
var _ref2;
|
|
7137
|
+
|
|
7138
|
+
var item = data;
|
|
7139
|
+
var itemContainer = (_ref2 = item && item.itemContainer) != null ? _ref2 : null;
|
|
7140
|
+
return React__default.createElement(ItemSlot, {
|
|
7141
|
+
key: i,
|
|
7142
|
+
slotIndex: i,
|
|
7143
|
+
item: item,
|
|
7144
|
+
itemContainer: itemContainer,
|
|
7145
|
+
slotContainerType: exports.SlotContainerType.EQUIPMENT_SET,
|
|
7146
|
+
slotSpriteMask: slotMaksRange[i],
|
|
7147
|
+
onMouseOver: handleOnMouseHover,
|
|
7148
|
+
onMouseOut: function onMouseOut() {
|
|
7149
|
+
uiStore.clearItemHoverDetail();
|
|
7150
|
+
},
|
|
7151
|
+
onClick: uiStore.handleOnItemClick,
|
|
7152
|
+
onCancelContextMenu: function onCancelContextMenu() {
|
|
7153
|
+
uiStore.clearContextMenu();
|
|
7154
|
+
}
|
|
7155
|
+
});
|
|
7156
|
+
});
|
|
7157
|
+
};
|
|
7158
|
+
|
|
7159
|
+
return React__default.createElement(DraggableContainer, {
|
|
7160
|
+
title: 'Equipments',
|
|
7161
|
+
type: exports.RPGUIContainerTypes.Framed,
|
|
7162
|
+
onCloseButton: function onCloseButton() {
|
|
7163
|
+
if (onClose) onClose();
|
|
7164
|
+
},
|
|
7165
|
+
width: "330px",
|
|
7166
|
+
cancelDrag: ".equipment-container-body",
|
|
7167
|
+
onPositionChange: function onPositionChange(_ref3) {
|
|
7168
|
+
var x = _ref3.x,
|
|
7169
|
+
y = _ref3.y;
|
|
7170
|
+
setDraggablePosition({
|
|
7171
|
+
x: x,
|
|
7172
|
+
y: y
|
|
7173
|
+
});
|
|
7174
|
+
},
|
|
7175
|
+
onOutsideClick: function onOutsideClick() {
|
|
7176
|
+
uiStore.clearContextMenu();
|
|
7177
|
+
uiStore.clearItemHoverDetail();
|
|
7178
|
+
}
|
|
7179
|
+
}, React__default.createElement(EquipmentSetContainer, {
|
|
7180
|
+
className: "equipment-container-body"
|
|
7181
|
+
}, 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, {
|
|
7182
|
+
x: uiStore.contextMenu.posX - draggablePosition.x,
|
|
7183
|
+
y: uiStore.contextMenu.posY - draggablePosition.y,
|
|
7184
|
+
options: uiStore.contextMenu.contextActions,
|
|
7185
|
+
onSelected: onSelected
|
|
7186
|
+
}) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React__default.createElement(ItemCard, {
|
|
7187
|
+
item: uiStore.onHoverDetail.item,
|
|
7188
|
+
x: uiStore.onHoverDetail.posX - draggablePosition.x,
|
|
7189
|
+
y: uiStore.onHoverDetail.posY - draggablePosition.y
|
|
7190
|
+
}) : null);
|
|
7118
7191
|
});
|
|
7192
|
+
var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
|
|
7193
|
+
displayName: "EquipmentSet__EquipmentSetContainer",
|
|
7194
|
+
componentId: "sc-1wuddg2-0"
|
|
7195
|
+
})(["width:inherit;display:flex;justify-content:center;flex-wrap:wrap;flex-direction:row;"]);
|
|
7196
|
+
var EquipmentColumn = /*#__PURE__*/styled.div.withConfig({
|
|
7197
|
+
displayName: "EquipmentSet__EquipmentColumn",
|
|
7198
|
+
componentId: "sc-1wuddg2-1"
|
|
7199
|
+
})(["display:flex;justify-content:center;flex-wrap:wrap;flex-direction:column;"]);
|
|
7200
|
+
|
|
7201
|
+
var SlotsContainer = function SlotsContainer(_ref) {
|
|
7202
|
+
var children = _ref.children,
|
|
7203
|
+
title = _ref.title,
|
|
7204
|
+
onClose = _ref.onClose,
|
|
7205
|
+
_onPositionChange = _ref.onPositionChange,
|
|
7206
|
+
onOutsideClick = _ref.onOutsideClick;
|
|
7207
|
+
return React__default.createElement(DraggableContainer, {
|
|
7208
|
+
title: title,
|
|
7209
|
+
type: exports.RPGUIContainerTypes.Framed,
|
|
7210
|
+
onCloseButton: function onCloseButton() {
|
|
7211
|
+
if (onClose) {
|
|
7212
|
+
onClose();
|
|
7213
|
+
}
|
|
7214
|
+
},
|
|
7215
|
+
width: "330px",
|
|
7216
|
+
cancelDrag: ".item-container-body",
|
|
7217
|
+
onPositionChange: function onPositionChange(_ref2) {
|
|
7218
|
+
var x = _ref2.x,
|
|
7219
|
+
y = _ref2.y;
|
|
7220
|
+
|
|
7221
|
+
if (_onPositionChange) {
|
|
7222
|
+
_onPositionChange({
|
|
7223
|
+
x: x,
|
|
7224
|
+
y: y
|
|
7225
|
+
});
|
|
7226
|
+
}
|
|
7227
|
+
},
|
|
7228
|
+
onOutsideClick: onOutsideClick
|
|
7229
|
+
}, children);
|
|
7230
|
+
};
|
|
7119
7231
|
|
|
7120
7232
|
var ItemContainer = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
7121
7233
|
var _uiStore$contextMenu, _uiStore$onHoverDetai;
|
|
@@ -7192,8 +7304,8 @@ var ItemContainer = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
|
7192
7304
|
onSelected: onSelected
|
|
7193
7305
|
}) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React__default.createElement(ItemCard, {
|
|
7194
7306
|
item: uiStore.onHoverDetail.item,
|
|
7195
|
-
x: uiStore.onHoverDetail.posX,
|
|
7196
|
-
y: uiStore.onHoverDetail.posY
|
|
7307
|
+
x: uiStore.onHoverDetail.posX - draggablePosition.x,
|
|
7308
|
+
y: uiStore.onHoverDetail.posY - draggablePosition.y
|
|
7197
7309
|
}) : null);
|
|
7198
7310
|
});
|
|
7199
7311
|
var ItemsContainer = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -7732,22 +7844,368 @@ var Input$1 = /*#__PURE__*/styled.input.withConfig({
|
|
|
7732
7844
|
componentId: "sc-v8mte9-0"
|
|
7733
7845
|
})(["opacity:0;"]);
|
|
7734
7846
|
|
|
7735
|
-
var
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7847
|
+
var frames$1 = {
|
|
7848
|
+
"metamask-large.png": {
|
|
7849
|
+
frame: {
|
|
7850
|
+
x: 0,
|
|
7851
|
+
y: 0,
|
|
7852
|
+
w: 33,
|
|
7853
|
+
h: 30
|
|
7854
|
+
},
|
|
7855
|
+
rotated: false,
|
|
7856
|
+
trimmed: false,
|
|
7857
|
+
spriteSourceSize: {
|
|
7858
|
+
x: 0,
|
|
7859
|
+
y: 0,
|
|
7860
|
+
w: 33,
|
|
7861
|
+
h: 30
|
|
7862
|
+
},
|
|
7863
|
+
sourceSize: {
|
|
7864
|
+
w: 33,
|
|
7865
|
+
h: 30
|
|
7866
|
+
},
|
|
7867
|
+
pivot: {
|
|
7868
|
+
x: 0.5,
|
|
7869
|
+
y: 0.5
|
|
7870
|
+
}
|
|
7871
|
+
},
|
|
7872
|
+
"chat-large.png": {
|
|
7873
|
+
frame: {
|
|
7874
|
+
x: 0,
|
|
7875
|
+
y: 30,
|
|
7876
|
+
w: 31,
|
|
7877
|
+
h: 29
|
|
7878
|
+
},
|
|
7879
|
+
rotated: false,
|
|
7880
|
+
trimmed: true,
|
|
7881
|
+
spriteSourceSize: {
|
|
7882
|
+
x: 1,
|
|
7883
|
+
y: 3,
|
|
7884
|
+
w: 31,
|
|
7885
|
+
h: 29
|
|
7886
|
+
},
|
|
7887
|
+
sourceSize: {
|
|
7888
|
+
w: 32,
|
|
7889
|
+
h: 32
|
|
7890
|
+
},
|
|
7891
|
+
pivot: {
|
|
7892
|
+
x: 0.5,
|
|
7893
|
+
y: 0.5
|
|
7894
|
+
}
|
|
7895
|
+
},
|
|
7896
|
+
"equipment.png": {
|
|
7897
|
+
frame: {
|
|
7898
|
+
x: 33,
|
|
7899
|
+
y: 0,
|
|
7900
|
+
w: 17,
|
|
7901
|
+
h: 16
|
|
7902
|
+
},
|
|
7903
|
+
rotated: false,
|
|
7904
|
+
trimmed: false,
|
|
7905
|
+
spriteSourceSize: {
|
|
7906
|
+
x: 0,
|
|
7907
|
+
y: 0,
|
|
7908
|
+
w: 17,
|
|
7909
|
+
h: 16
|
|
7910
|
+
},
|
|
7911
|
+
sourceSize: {
|
|
7912
|
+
w: 17,
|
|
7913
|
+
h: 16
|
|
7914
|
+
},
|
|
7915
|
+
pivot: {
|
|
7916
|
+
x: 0.5,
|
|
7917
|
+
y: 0.5
|
|
7918
|
+
}
|
|
7919
|
+
},
|
|
7920
|
+
"inventory.png": {
|
|
7921
|
+
frame: {
|
|
7922
|
+
x: 33,
|
|
7923
|
+
y: 16,
|
|
7924
|
+
w: 17,
|
|
7925
|
+
h: 16
|
|
7926
|
+
},
|
|
7927
|
+
rotated: false,
|
|
7928
|
+
trimmed: false,
|
|
7929
|
+
spriteSourceSize: {
|
|
7930
|
+
x: 0,
|
|
7931
|
+
y: 0,
|
|
7932
|
+
w: 17,
|
|
7933
|
+
h: 16
|
|
7934
|
+
},
|
|
7935
|
+
sourceSize: {
|
|
7936
|
+
w: 17,
|
|
7937
|
+
h: 16
|
|
7938
|
+
},
|
|
7939
|
+
pivot: {
|
|
7940
|
+
x: 0.5,
|
|
7941
|
+
y: 0.5
|
|
7942
|
+
}
|
|
7943
|
+
},
|
|
7944
|
+
"icon-base-blue.png": {
|
|
7945
|
+
frame: {
|
|
7946
|
+
x: 31,
|
|
7947
|
+
y: 32,
|
|
7948
|
+
w: 16,
|
|
7949
|
+
h: 16
|
|
7950
|
+
},
|
|
7951
|
+
rotated: false,
|
|
7952
|
+
trimmed: false,
|
|
7953
|
+
spriteSourceSize: {
|
|
7954
|
+
x: 0,
|
|
7955
|
+
y: 0,
|
|
7956
|
+
w: 16,
|
|
7957
|
+
h: 16
|
|
7958
|
+
},
|
|
7959
|
+
sourceSize: {
|
|
7960
|
+
w: 16,
|
|
7961
|
+
h: 16
|
|
7962
|
+
},
|
|
7963
|
+
pivot: {
|
|
7964
|
+
x: 0.5,
|
|
7965
|
+
y: 0.5
|
|
7966
|
+
}
|
|
7967
|
+
},
|
|
7968
|
+
"icon-base-brown.png": {
|
|
7969
|
+
frame: {
|
|
7970
|
+
x: 50,
|
|
7971
|
+
y: 0,
|
|
7972
|
+
w: 16,
|
|
7973
|
+
h: 16
|
|
7974
|
+
},
|
|
7975
|
+
rotated: false,
|
|
7976
|
+
trimmed: false,
|
|
7977
|
+
spriteSourceSize: {
|
|
7978
|
+
x: 0,
|
|
7979
|
+
y: 0,
|
|
7980
|
+
w: 16,
|
|
7981
|
+
h: 16
|
|
7982
|
+
},
|
|
7983
|
+
sourceSize: {
|
|
7984
|
+
w: 16,
|
|
7985
|
+
h: 16
|
|
7986
|
+
},
|
|
7987
|
+
pivot: {
|
|
7988
|
+
x: 0.5,
|
|
7989
|
+
y: 0.5
|
|
7990
|
+
}
|
|
7991
|
+
},
|
|
7992
|
+
"chat-small.png": {
|
|
7993
|
+
frame: {
|
|
7994
|
+
x: 50,
|
|
7995
|
+
y: 16,
|
|
7996
|
+
w: 16,
|
|
7997
|
+
h: 16
|
|
7998
|
+
},
|
|
7999
|
+
rotated: false,
|
|
8000
|
+
trimmed: true,
|
|
8001
|
+
spriteSourceSize: {
|
|
8002
|
+
x: 1,
|
|
8003
|
+
y: 0,
|
|
8004
|
+
w: 16,
|
|
8005
|
+
h: 16
|
|
8006
|
+
},
|
|
8007
|
+
sourceSize: {
|
|
8008
|
+
w: 17,
|
|
8009
|
+
h: 16
|
|
8010
|
+
},
|
|
8011
|
+
pivot: {
|
|
8012
|
+
x: 0.5,
|
|
8013
|
+
y: 0.5
|
|
8014
|
+
}
|
|
8015
|
+
},
|
|
8016
|
+
"icon-base-gold.png": {
|
|
8017
|
+
frame: {
|
|
8018
|
+
x: 47,
|
|
8019
|
+
y: 32,
|
|
8020
|
+
w: 16,
|
|
8021
|
+
h: 16
|
|
8022
|
+
},
|
|
8023
|
+
rotated: false,
|
|
8024
|
+
trimmed: false,
|
|
8025
|
+
spriteSourceSize: {
|
|
8026
|
+
x: 0,
|
|
8027
|
+
y: 0,
|
|
8028
|
+
w: 16,
|
|
8029
|
+
h: 16
|
|
8030
|
+
},
|
|
8031
|
+
sourceSize: {
|
|
8032
|
+
w: 16,
|
|
8033
|
+
h: 16
|
|
8034
|
+
},
|
|
8035
|
+
pivot: {
|
|
8036
|
+
x: 0.5,
|
|
8037
|
+
y: 0.5
|
|
8038
|
+
}
|
|
8039
|
+
},
|
|
8040
|
+
"equipment-raw.png": {
|
|
8041
|
+
frame: {
|
|
8042
|
+
x: 0,
|
|
8043
|
+
y: 59,
|
|
8044
|
+
w: 15,
|
|
8045
|
+
h: 13
|
|
8046
|
+
},
|
|
8047
|
+
rotated: false,
|
|
8048
|
+
trimmed: true,
|
|
8049
|
+
spriteSourceSize: {
|
|
8050
|
+
x: 0,
|
|
8051
|
+
y: 0,
|
|
8052
|
+
w: 15,
|
|
8053
|
+
h: 13
|
|
8054
|
+
},
|
|
8055
|
+
sourceSize: {
|
|
8056
|
+
w: 16,
|
|
8057
|
+
h: 13
|
|
8058
|
+
},
|
|
8059
|
+
pivot: {
|
|
8060
|
+
x: 0.5,
|
|
8061
|
+
y: 0.5
|
|
8062
|
+
}
|
|
8063
|
+
},
|
|
8064
|
+
"metamask-small.png": {
|
|
8065
|
+
frame: {
|
|
8066
|
+
x: 31,
|
|
8067
|
+
y: 48,
|
|
8068
|
+
w: 15,
|
|
8069
|
+
h: 15
|
|
8070
|
+
},
|
|
8071
|
+
rotated: false,
|
|
8072
|
+
trimmed: true,
|
|
8073
|
+
spriteSourceSize: {
|
|
8074
|
+
x: 1,
|
|
8075
|
+
y: 0,
|
|
8076
|
+
w: 15,
|
|
8077
|
+
h: 15
|
|
8078
|
+
},
|
|
8079
|
+
sourceSize: {
|
|
8080
|
+
w: 16,
|
|
8081
|
+
h: 16
|
|
8082
|
+
},
|
|
8083
|
+
pivot: {
|
|
8084
|
+
x: 0.5,
|
|
8085
|
+
y: 0.5
|
|
8086
|
+
}
|
|
8087
|
+
},
|
|
8088
|
+
"settings.png": {
|
|
8089
|
+
frame: {
|
|
8090
|
+
x: 46,
|
|
8091
|
+
y: 48,
|
|
8092
|
+
w: 14,
|
|
8093
|
+
h: 14
|
|
8094
|
+
},
|
|
8095
|
+
rotated: false,
|
|
8096
|
+
trimmed: true,
|
|
8097
|
+
spriteSourceSize: {
|
|
8098
|
+
x: 1,
|
|
8099
|
+
y: 1,
|
|
8100
|
+
w: 14,
|
|
8101
|
+
h: 14
|
|
8102
|
+
},
|
|
8103
|
+
sourceSize: {
|
|
8104
|
+
w: 16,
|
|
8105
|
+
h: 16
|
|
8106
|
+
},
|
|
8107
|
+
pivot: {
|
|
8108
|
+
x: 0.5,
|
|
8109
|
+
y: 0.5
|
|
8110
|
+
}
|
|
8111
|
+
},
|
|
8112
|
+
"inventory-raw.png": {
|
|
8113
|
+
frame: {
|
|
8114
|
+
x: 15,
|
|
8115
|
+
y: 59,
|
|
8116
|
+
w: 13,
|
|
8117
|
+
h: 13
|
|
8118
|
+
},
|
|
8119
|
+
rotated: false,
|
|
8120
|
+
trimmed: true,
|
|
8121
|
+
spriteSourceSize: {
|
|
8122
|
+
x: 1,
|
|
8123
|
+
y: 2,
|
|
8124
|
+
w: 13,
|
|
8125
|
+
h: 13
|
|
8126
|
+
},
|
|
8127
|
+
sourceSize: {
|
|
8128
|
+
w: 16,
|
|
8129
|
+
h: 16
|
|
8130
|
+
},
|
|
8131
|
+
pivot: {
|
|
8132
|
+
x: 0.5,
|
|
8133
|
+
y: 0.5
|
|
8134
|
+
}
|
|
8135
|
+
}
|
|
8136
|
+
};
|
|
8137
|
+
var meta$1 = {
|
|
8138
|
+
app: "http://free-tex-packer.com",
|
|
8139
|
+
version: "0.6.7",
|
|
8140
|
+
image: "icons.png",
|
|
8141
|
+
format: "RGBA8888",
|
|
8142
|
+
size: {
|
|
8143
|
+
w: 66,
|
|
8144
|
+
h: 72
|
|
8145
|
+
},
|
|
8146
|
+
scale: 1
|
|
8147
|
+
};
|
|
8148
|
+
var iconsAtlasJSON = {
|
|
8149
|
+
frames: frames$1,
|
|
8150
|
+
meta: meta$1
|
|
8151
|
+
};
|
|
8152
|
+
|
|
8153
|
+
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==';
|
|
8154
|
+
|
|
8155
|
+
var SpriteIcon = function SpriteIcon(_ref) {
|
|
8156
|
+
var onClick = _ref.onClick,
|
|
8157
|
+
spriteKey = _ref.spriteKey,
|
|
8158
|
+
baseSpriteKey = _ref.baseSpriteKey,
|
|
8159
|
+
imgStyle = _ref.imgStyle;
|
|
8160
|
+
return React__default.createElement(Container$b, null, baseSpriteKey && React__default.createElement(Slot, null, React__default.createElement(SpriteFromAtlas, {
|
|
8161
|
+
onClick: onClick,
|
|
8162
|
+
atlasJSON: iconsAtlasJSON,
|
|
8163
|
+
atlasIMG: img$3,
|
|
8164
|
+
spriteKey: baseSpriteKey,
|
|
8165
|
+
width: 32,
|
|
8166
|
+
height: 32,
|
|
8167
|
+
containerStyle: {
|
|
8168
|
+
zIndex: -1
|
|
8169
|
+
}
|
|
8170
|
+
})), React__default.createElement(Slot, null, React__default.createElement(SpriteFromAtlas, {
|
|
8171
|
+
onClick: onClick,
|
|
8172
|
+
atlasJSON: iconsAtlasJSON,
|
|
8173
|
+
atlasIMG: img$3,
|
|
8174
|
+
spriteKey: spriteKey,
|
|
8175
|
+
width: 28,
|
|
8176
|
+
height: 28,
|
|
8177
|
+
containerStyle: {
|
|
8178
|
+
zIndex: 0
|
|
8179
|
+
},
|
|
8180
|
+
imgScale: baseSpriteKey ? 1.5 : 2,
|
|
8181
|
+
imgStyle: imgStyle
|
|
8182
|
+
})));
|
|
8183
|
+
};
|
|
8184
|
+
var Container$b = /*#__PURE__*/styled.div.withConfig({
|
|
8185
|
+
displayName: "SpriteIcon__Container",
|
|
8186
|
+
componentId: "sc-vi5t1x-0"
|
|
8187
|
+
})(["position:relative;width:32px;height:32px;display:flex;justify-content:center;align-items:center;"]);
|
|
8188
|
+
var Slot = /*#__PURE__*/styled.div.withConfig({
|
|
8189
|
+
displayName: "SpriteIcon__Slot",
|
|
8190
|
+
componentId: "sc-vi5t1x-1"
|
|
8191
|
+
})(["position:absolute;"]);
|
|
8192
|
+
|
|
8193
|
+
var SimpleProgressBar = function SimpleProgressBar(_ref) {
|
|
8194
|
+
var value = _ref.value,
|
|
8195
|
+
_ref$bgColor = _ref.bgColor,
|
|
8196
|
+
bgColor = _ref$bgColor === void 0 ? 'red' : _ref$bgColor,
|
|
8197
|
+
_ref$margin = _ref.margin,
|
|
8198
|
+
margin = _ref$margin === void 0 ? 20 : _ref$margin;
|
|
8199
|
+
return React__default.createElement(Container$c, {
|
|
8200
|
+
className: "simple-progress-bar"
|
|
8201
|
+
}, React__default.createElement(ProgressBarContainer, {
|
|
8202
|
+
margin: margin
|
|
8203
|
+
}, React__default.createElement(BackgroundBar, null, React__default.createElement(Progress, {
|
|
8204
|
+
value: value,
|
|
7747
8205
|
bgColor: bgColor
|
|
7748
8206
|
}))));
|
|
7749
8207
|
};
|
|
7750
|
-
var Container$
|
|
8208
|
+
var Container$c = /*#__PURE__*/styled.div.withConfig({
|
|
7751
8209
|
displayName: "SimpleProgressBar__Container",
|
|
7752
8210
|
componentId: "sc-mbeil3-0"
|
|
7753
8211
|
})(["display:flex;justify-content:center;align-items:center;width:100%;"]);
|
|
@@ -7784,7 +8242,7 @@ var SkillProgressBar = function SkillProgressBar(_ref) {
|
|
|
7784
8242
|
atlasIMG: img,
|
|
7785
8243
|
atlasJSON: atlasJSON,
|
|
7786
8244
|
spriteKey: texturePath,
|
|
7787
|
-
|
|
8245
|
+
imgScale: 1,
|
|
7788
8246
|
grayScale: true,
|
|
7789
8247
|
opacity: 0.5
|
|
7790
8248
|
})) : React__default.createElement(React__default.Fragment, null)), React__default.createElement(ProgressBarContainer$1, null, React__default.createElement(SimpleProgressBar, {
|
|
@@ -7840,123 +8298,17 @@ var Truncate = function Truncate(_ref) {
|
|
|
7840
8298
|
var _ref$maxLines = _ref.maxLines,
|
|
7841
8299
|
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
7842
8300
|
children = _ref.children;
|
|
7843
|
-
return React__default.createElement(Container$
|
|
8301
|
+
return React__default.createElement(Container$d, {
|
|
7844
8302
|
maxLines: maxLines
|
|
7845
8303
|
}, children);
|
|
7846
8304
|
};
|
|
7847
|
-
var Container$
|
|
8305
|
+
var Container$d = /*#__PURE__*/styled.div.withConfig({
|
|
7848
8306
|
displayName: "Truncate__Container",
|
|
7849
8307
|
componentId: "sc-6x00qb-0"
|
|
7850
8308
|
})(["display:-webkit-box;max-width:100%;max-height:100%;-webkit-line-clamp:", ";-webkit-box-orient:vertical;overflow:hidden;"], function (props) {
|
|
7851
8309
|
return props.maxLines;
|
|
7852
8310
|
});
|
|
7853
8311
|
|
|
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
8312
|
exports.Button = Button;
|
|
7961
8313
|
exports.Chat = Chat;
|
|
7962
8314
|
exports.CheckButton = CheckButton;
|
|
@@ -7977,6 +8329,7 @@ exports.RPGUIRoot = RPGUIRoot;
|
|
|
7977
8329
|
exports.RangeSlider = RangeSlider;
|
|
7978
8330
|
exports.SkillProgressBar = SkillProgressBar;
|
|
7979
8331
|
exports.SpriteFromAtlas = SpriteFromAtlas;
|
|
8332
|
+
exports.SpriteIcon = SpriteIcon;
|
|
7980
8333
|
exports.TextArea = TextArea;
|
|
7981
8334
|
exports.Truncate = Truncate;
|
|
7982
8335
|
exports._RPGUI = _RPGUI;
|