@rpg-engine/long-bow 0.3.87 → 0.3.89
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/Inventory/ItemSlot.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +30 -12
- 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 +30 -12
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/CircularController/CircularController.tsx +1 -0
- package/src/components/Item/Inventory/ItemContainer.tsx +10 -6
- package/src/components/Item/Inventory/ItemSlot.tsx +14 -0
- package/src/components/Shortcuts/Shortcuts.tsx +1 -0
- package/src/components/Shortcuts/ShortcutsSetter.tsx +8 -1
- package/src/components/TradingMenu/TradingItemRow.tsx +1 -0
package/dist/long-bow.esm.js
CHANGED
|
@@ -33111,7 +33111,8 @@ var CircularController = function CircularController(_ref) {
|
|
|
33111
33111
|
spriteKey: getItemTextureKeyPath({
|
|
33112
33112
|
key: _payload.texturePath,
|
|
33113
33113
|
texturePath: _payload.texturePath,
|
|
33114
|
-
stackQty: _payload.stackQty || 1
|
|
33114
|
+
stackQty: _payload.stackQty || 1,
|
|
33115
|
+
isStackable: _payload.isStackable
|
|
33115
33116
|
}, atlasJSON),
|
|
33116
33117
|
width: 32,
|
|
33117
33118
|
height: 32,
|
|
@@ -33653,6 +33654,7 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33653
33654
|
dragScale = _ref.dragScale,
|
|
33654
33655
|
isSelectingShortcut = _ref.isSelectingShortcut,
|
|
33655
33656
|
equipmentSet = _ref.equipmentSet,
|
|
33657
|
+
setItemShortcut = _ref.setItemShortcut,
|
|
33656
33658
|
isDepotSystem = _ref.isDepotSystem;
|
|
33657
33659
|
var _useState = useState(false),
|
|
33658
33660
|
isTooltipVisible = _useState[0],
|
|
@@ -33838,6 +33840,13 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33838
33840
|
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33839
33841
|
scale: dragScale,
|
|
33840
33842
|
onStop: function onStop(e, data) {
|
|
33843
|
+
var target = e.target;
|
|
33844
|
+
if (target != null && target.id.includes('shortcutSetter') && setItemShortcut && item) {
|
|
33845
|
+
var index = parseInt(target.id.split('_')[1]);
|
|
33846
|
+
if (!isNaN(index)) {
|
|
33847
|
+
setItemShortcut(item, index);
|
|
33848
|
+
}
|
|
33849
|
+
}
|
|
33841
33850
|
if (wasDragged && item && !isSelectingShortcut) {
|
|
33842
33851
|
var _e$target;
|
|
33843
33852
|
//@ts-ignore
|
|
@@ -33852,9 +33861,9 @@ var ItemSlot = /*#__PURE__*/observer(function (_ref) {
|
|
|
33852
33861
|
});
|
|
33853
33862
|
}
|
|
33854
33863
|
setWasDragged(false);
|
|
33855
|
-
var
|
|
33856
|
-
if (!
|
|
33857
|
-
var style = window.getComputedStyle(
|
|
33864
|
+
var _target = dragContainer.current;
|
|
33865
|
+
if (!_target || !wasDragged) return;
|
|
33866
|
+
var style = window.getComputedStyle(_target);
|
|
33858
33867
|
var matrix = new DOMMatrixReadOnly(style.transform);
|
|
33859
33868
|
var x = matrix.m41;
|
|
33860
33869
|
var y = matrix.m42;
|
|
@@ -35356,7 +35365,8 @@ var ShortcutsSetter = function ShortcutsSetter(_ref) {
|
|
|
35356
35365
|
spriteKey: getItemTextureKeyPath({
|
|
35357
35366
|
key: _payload.texturePath,
|
|
35358
35367
|
texturePath: _payload.texturePath,
|
|
35359
|
-
stackQty: _payload.stackQty || 1
|
|
35368
|
+
stackQty: _payload.stackQty || 1,
|
|
35369
|
+
isStackable: _payload.isStackable
|
|
35360
35370
|
}, atlasJSON),
|
|
35361
35371
|
width: 32,
|
|
35362
35372
|
height: 32,
|
|
@@ -35379,11 +35389,13 @@ var ShortcutsSetter = function ShortcutsSetter(_ref) {
|
|
|
35379
35389
|
return React.createElement(Shortcut, {
|
|
35380
35390
|
key: i,
|
|
35381
35391
|
onPointerDown: function onPointerDown() {
|
|
35392
|
+
if (settingShortcutIndex !== -1) setSettingShortcutIndex(-1);
|
|
35382
35393
|
removeShortcut(i);
|
|
35383
|
-
if (!shortcuts[i] || shortcuts[i].type === ShortcutType.None) setSettingShortcutIndex(i);
|
|
35394
|
+
if (settingShortcutIndex === -1 && (!shortcuts[i] || shortcuts[i].type === ShortcutType.None)) setSettingShortcutIndex(i);
|
|
35384
35395
|
},
|
|
35385
35396
|
disabled: settingShortcutIndex !== -1 && settingShortcutIndex !== i,
|
|
35386
|
-
isBeingSet: settingShortcutIndex === i
|
|
35397
|
+
isBeingSet: settingShortcutIndex === i,
|
|
35398
|
+
id: "shortcutSetter_" + i
|
|
35387
35399
|
}, getContent(i));
|
|
35388
35400
|
})));
|
|
35389
35401
|
};
|
|
@@ -35439,6 +35451,11 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
35439
35451
|
var _useState2 = useState(-1),
|
|
35440
35452
|
settingShortcutIndex = _useState2[0],
|
|
35441
35453
|
setSettingShortcutIndex = _useState2[1];
|
|
35454
|
+
var handleSetShortcut = function handleSetShortcut(item, index) {
|
|
35455
|
+
if (item.type === ItemType.Consumable || item.type === ItemType.Tool) {
|
|
35456
|
+
setItemShortcut == null ? void 0 : setItemShortcut(item.key, index);
|
|
35457
|
+
}
|
|
35458
|
+
};
|
|
35442
35459
|
var onRenderSlots = function onRenderSlots() {
|
|
35443
35460
|
var slots = [];
|
|
35444
35461
|
for (var i = 0; i < itemContainer.slotQty; i++) {
|
|
@@ -35455,9 +35472,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
35455
35472
|
onPointerDown: function onPointerDown(itemType, containerType, item) {
|
|
35456
35473
|
if (settingShortcutIndex !== -1) {
|
|
35457
35474
|
setSettingShortcutIndex(-1);
|
|
35458
|
-
|
|
35459
|
-
setItemShortcut == null ? void 0 : setItemShortcut(item.key, settingShortcutIndex);
|
|
35460
|
-
}
|
|
35475
|
+
handleSetShortcut(item, settingShortcutIndex);
|
|
35461
35476
|
} else if (onItemClick) onItemClick(item, itemType, containerType);
|
|
35462
35477
|
},
|
|
35463
35478
|
onSelected: function onSelected(optionId, item) {
|
|
@@ -35489,6 +35504,7 @@ var ItemContainer$1 = function ItemContainer(_ref) {
|
|
|
35489
35504
|
atlasJSON: atlasJSON,
|
|
35490
35505
|
isSelectingShortcut: settingShortcutIndex !== -1,
|
|
35491
35506
|
equipmentSet: equipmentSet,
|
|
35507
|
+
setItemShortcut: type === ItemContainerType.Inventory ? handleSetShortcut : undefined,
|
|
35492
35508
|
isDepotSystem: isDepotSystem
|
|
35493
35509
|
}));
|
|
35494
35510
|
}
|
|
@@ -35987,7 +36003,8 @@ var Shortcuts = function Shortcuts(_ref) {
|
|
|
35987
36003
|
spriteKey: getItemTextureKeyPath({
|
|
35988
36004
|
key: _payload.texturePath,
|
|
35989
36005
|
texturePath: _payload.texturePath,
|
|
35990
|
-
stackQty: _payload.stackQty || 1
|
|
36006
|
+
stackQty: _payload.stackQty || 1,
|
|
36007
|
+
isStackable: _payload.isStackable
|
|
35991
36008
|
}, atlasJSON),
|
|
35992
36009
|
width: 32,
|
|
35993
36010
|
height: 32
|
|
@@ -36502,7 +36519,8 @@ var TradingItemRow = function TradingItemRow(_ref) {
|
|
|
36502
36519
|
spriteKey: getItemTextureKeyPath({
|
|
36503
36520
|
key: traderItem.key,
|
|
36504
36521
|
stackQty: traderItem.stackQty || 1,
|
|
36505
|
-
texturePath: traderItem.texturePath
|
|
36522
|
+
texturePath: traderItem.texturePath,
|
|
36523
|
+
isStackable: traderItem.isStackable
|
|
36506
36524
|
}, atlasJSON),
|
|
36507
36525
|
imgScale: 2.5
|
|
36508
36526
|
})))), React.createElement(ItemNameContainer, null, React.createElement(NameValue, null, React.createElement("p", null, React.createElement(Ellipsis, {
|