@rpg-engine/long-bow 0.1.792 → 0.1.794
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/store/UI.store.d.ts +1 -0
- package/dist/long-bow.cjs.development.js +36 -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 +36 -3
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Equipment/EquipmentSet.tsx +3 -3
- package/src/components/store/UI.store.ts +32 -5
package/dist/long-bow.esm.js
CHANGED
|
@@ -5998,6 +5998,8 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
5998
5998
|
return;
|
|
5999
5999
|
}
|
|
6000
6000
|
|
|
6001
|
+
_this.setDraggablePosition(_this.getOffsets());
|
|
6002
|
+
|
|
6001
6003
|
switch (slotContainerType) {
|
|
6002
6004
|
case SlotContainerType.EQUIPMENT_SET:
|
|
6003
6005
|
_this.setEquipContextMenu({
|
|
@@ -6034,6 +6036,8 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6034
6036
|
|
|
6035
6037
|
this.handleOnMouseHover = function (event, slotIndex, item, posX, posY, onMouseOver) {
|
|
6036
6038
|
if (item) {
|
|
6039
|
+
_this.setDraggablePosition(_this.getOffsets());
|
|
6040
|
+
|
|
6037
6041
|
_this.setItemHoverDetail({
|
|
6038
6042
|
visible: true,
|
|
6039
6043
|
posX: posX,
|
|
@@ -6047,6 +6051,34 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6047
6051
|
}
|
|
6048
6052
|
};
|
|
6049
6053
|
|
|
6054
|
+
this.getOffsets = function () {
|
|
6055
|
+
var p = {
|
|
6056
|
+
x: 0,
|
|
6057
|
+
y: 0
|
|
6058
|
+
}; // const body = document.getElementsByTagName('body')
|
|
6059
|
+
|
|
6060
|
+
var body = document.querySelector('body');
|
|
6061
|
+
|
|
6062
|
+
if (body != null) {
|
|
6063
|
+
p.x = body.offsetLeft;
|
|
6064
|
+
p.y = body.offsetTop;
|
|
6065
|
+
|
|
6066
|
+
while (body.offsetParent) {
|
|
6067
|
+
console.log("offsetParent: " + body.offsetParent);
|
|
6068
|
+
p.x = p.x + body.offsetLeft;
|
|
6069
|
+
p.y = p.y + body.offsetTop;
|
|
6070
|
+
|
|
6071
|
+
if (body == document.getElementsByTagName("body")[0]) {
|
|
6072
|
+
break;
|
|
6073
|
+
} else {
|
|
6074
|
+
body = body.offsetParent;
|
|
6075
|
+
}
|
|
6076
|
+
}
|
|
6077
|
+
}
|
|
6078
|
+
|
|
6079
|
+
return p;
|
|
6080
|
+
};
|
|
6081
|
+
|
|
6050
6082
|
makeAutoObservable(this);
|
|
6051
6083
|
}
|
|
6052
6084
|
|
|
@@ -6188,7 +6220,8 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6188
6220
|
setDraggablePosition({
|
|
6189
6221
|
x: x,
|
|
6190
6222
|
y: y
|
|
6191
|
-
});
|
|
6223
|
+
});
|
|
6224
|
+
console.log(draggablePosition);
|
|
6192
6225
|
},
|
|
6193
6226
|
onOutsideClick: function onOutsideClick() {
|
|
6194
6227
|
uiStore.clearContextMenu();
|
|
@@ -6197,8 +6230,8 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6197
6230
|
}, React.createElement(EquipmentSetContainer, {
|
|
6198
6231
|
className: "equipment-container-body"
|
|
6199
6232
|
}, React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(0, 3)), React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(3, 7)), React.createElement(EquipmentColumn, null, onRenderEquipmentSlotRange(7, 10))), (_uiStore$contextMenu = uiStore.contextMenu) != null && _uiStore$contextMenu.visible ? React.createElement(ListMenu, {
|
|
6200
|
-
x: uiStore.contextMenu.posX - draggablePosition.x,
|
|
6201
|
-
y: uiStore.contextMenu.posY - draggablePosition.y,
|
|
6233
|
+
x: uiStore.contextMenu.posX - uiStore.draggablePosition.x,
|
|
6234
|
+
y: uiStore.contextMenu.posY - uiStore.draggablePosition.y,
|
|
6202
6235
|
options: uiStore.contextMenu.contextActions,
|
|
6203
6236
|
onSelected: onSelected
|
|
6204
6237
|
}) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React.createElement(ItemCard, {
|