@rpg-engine/long-bow 0.2.87 → 0.2.88
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/long-bow.cjs.development.js +23 -3
- 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 +23 -3
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Equipment/EquipmentSet.tsx +7 -0
- package/src/components/Item/Inventory/ItemQuantitySelector.tsx +6 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +72 -68
|
@@ -33635,8 +33635,12 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33635
33635
|
});
|
|
33636
33636
|
(_document$elementFrom = document.elementFromPoint(clientX, clientY)) == null ? void 0 : _document$elementFrom.dispatchEvent(simulatedEvent);
|
|
33637
33637
|
}
|
|
33638
|
-
},
|
|
33638
|
+
}, React__default.createElement(Draggable, {
|
|
33639
|
+
defaultClassName: item ? 'draggable' : 'empty-slot',
|
|
33639
33640
|
onStop: function onStop() {
|
|
33641
|
+
if (!item) {
|
|
33642
|
+
return;
|
|
33643
|
+
}
|
|
33640
33644
|
if (wasDragged) {
|
|
33641
33645
|
setWasDragged(false);
|
|
33642
33646
|
var target = dragContainer.current;
|
|
@@ -33666,13 +33670,19 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
33666
33670
|
}
|
|
33667
33671
|
},
|
|
33668
33672
|
onStart: function onStart() {
|
|
33669
|
-
if (
|
|
33673
|
+
if (!item) {
|
|
33674
|
+
return;
|
|
33675
|
+
}
|
|
33676
|
+
if (onDragStart) {
|
|
33677
|
+
onDragStart(item, slotIndex, containerType);
|
|
33678
|
+
}
|
|
33670
33679
|
},
|
|
33671
33680
|
onDrag: function onDrag() {
|
|
33672
33681
|
setWasDragged(true);
|
|
33673
33682
|
setIsFocused(true);
|
|
33674
33683
|
},
|
|
33675
|
-
position: dragPosition
|
|
33684
|
+
position: dragPosition,
|
|
33685
|
+
cancel: ".empty-slot"
|
|
33676
33686
|
}, React__default.createElement(ItemContainer, {
|
|
33677
33687
|
ref: dragContainer,
|
|
33678
33688
|
isFocused: isFocused,
|
|
@@ -33770,6 +33780,9 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33770
33780
|
if (_onSelected) _onSelected(optionId);
|
|
33771
33781
|
},
|
|
33772
33782
|
onDragStart: function onDragStart(item, slotIndex, itemContainerType) {
|
|
33783
|
+
if (!item) {
|
|
33784
|
+
return;
|
|
33785
|
+
}
|
|
33773
33786
|
if (onItemDragStart) onItemDragStart(item, slotIndex, itemContainerType);
|
|
33774
33787
|
},
|
|
33775
33788
|
onDragEnd: function onDragEnd(quantity) {
|
|
@@ -33777,6 +33790,9 @@ var EquipmentSet = function EquipmentSet(_ref) {
|
|
|
33777
33790
|
},
|
|
33778
33791
|
checkIfItemCanBeMoved: checkIfItemCanBeMoved,
|
|
33779
33792
|
onPlaceDrop: function onPlaceDrop(item, slotIndex, itemContainerType) {
|
|
33793
|
+
if (!item) {
|
|
33794
|
+
return;
|
|
33795
|
+
}
|
|
33780
33796
|
if (onItemPlaceDrop) onItemPlaceDrop(item, slotIndex, itemContainerType);
|
|
33781
33797
|
},
|
|
33782
33798
|
atlasIMG: atlasIMG,
|
|
@@ -34493,6 +34509,10 @@ var ItemQuantitySelector = function ItemQuantitySelector(_ref) {
|
|
|
34493
34509
|
max: quantity,
|
|
34494
34510
|
value: value,
|
|
34495
34511
|
onChange: function onChange(e) {
|
|
34512
|
+
if (Number(e.target.value) >= quantity) {
|
|
34513
|
+
setValue(quantity);
|
|
34514
|
+
return;
|
|
34515
|
+
}
|
|
34496
34516
|
setValue(e.target.value);
|
|
34497
34517
|
},
|
|
34498
34518
|
onBlur: function onBlur(e) {
|