@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
|
@@ -32,6 +32,7 @@ declare class UIStore {
|
|
|
32
32
|
handleOnMouseHover: (event: any, slotIndex: number, item: IItem | null, posX: number, posY: number, onMouseOver: any) => void;
|
|
33
33
|
onSelected(selectedActionId: ItemSocketEvents | string, onActionSelected: any): void;
|
|
34
34
|
setDraggablePosition(currentPosition: IPosition): void;
|
|
35
|
+
private getOffsets;
|
|
35
36
|
}
|
|
36
37
|
export declare const uiStore: UIStore;
|
|
37
38
|
export {};
|
|
@@ -6000,6 +6000,8 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6000
6000
|
return;
|
|
6001
6001
|
}
|
|
6002
6002
|
|
|
6003
|
+
_this.setDraggablePosition(_this.getOffsets());
|
|
6004
|
+
|
|
6003
6005
|
switch (slotContainerType) {
|
|
6004
6006
|
case exports.SlotContainerType.EQUIPMENT_SET:
|
|
6005
6007
|
_this.setEquipContextMenu({
|
|
@@ -6036,6 +6038,8 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6036
6038
|
|
|
6037
6039
|
this.handleOnMouseHover = function (event, slotIndex, item, posX, posY, onMouseOver) {
|
|
6038
6040
|
if (item) {
|
|
6041
|
+
_this.setDraggablePosition(_this.getOffsets());
|
|
6042
|
+
|
|
6039
6043
|
_this.setItemHoverDetail({
|
|
6040
6044
|
visible: true,
|
|
6041
6045
|
posX: posX,
|
|
@@ -6049,6 +6053,34 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6049
6053
|
}
|
|
6050
6054
|
};
|
|
6051
6055
|
|
|
6056
|
+
this.getOffsets = function () {
|
|
6057
|
+
var p = {
|
|
6058
|
+
x: 0,
|
|
6059
|
+
y: 0
|
|
6060
|
+
}; // const body = document.getElementsByTagName('body')
|
|
6061
|
+
|
|
6062
|
+
var body = document.querySelector('body');
|
|
6063
|
+
|
|
6064
|
+
if (body != null) {
|
|
6065
|
+
p.x = body.offsetLeft;
|
|
6066
|
+
p.y = body.offsetTop;
|
|
6067
|
+
|
|
6068
|
+
while (body.offsetParent) {
|
|
6069
|
+
console.log("offsetParent: " + body.offsetParent);
|
|
6070
|
+
p.x = p.x + body.offsetLeft;
|
|
6071
|
+
p.y = p.y + body.offsetTop;
|
|
6072
|
+
|
|
6073
|
+
if (body == document.getElementsByTagName("body")[0]) {
|
|
6074
|
+
break;
|
|
6075
|
+
} else {
|
|
6076
|
+
body = body.offsetParent;
|
|
6077
|
+
}
|
|
6078
|
+
}
|
|
6079
|
+
}
|
|
6080
|
+
|
|
6081
|
+
return p;
|
|
6082
|
+
};
|
|
6083
|
+
|
|
6052
6084
|
mobx.makeAutoObservable(this);
|
|
6053
6085
|
}
|
|
6054
6086
|
|
|
@@ -6190,7 +6222,8 @@ var EquipmentSet = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
|
6190
6222
|
setDraggablePosition({
|
|
6191
6223
|
x: x,
|
|
6192
6224
|
y: y
|
|
6193
|
-
});
|
|
6225
|
+
});
|
|
6226
|
+
console.log(draggablePosition);
|
|
6194
6227
|
},
|
|
6195
6228
|
onOutsideClick: function onOutsideClick() {
|
|
6196
6229
|
uiStore.clearContextMenu();
|
|
@@ -6199,8 +6232,8 @@ var EquipmentSet = /*#__PURE__*/mobxReact.observer(function (_ref) {
|
|
|
6199
6232
|
}, React__default.createElement(EquipmentSetContainer, {
|
|
6200
6233
|
className: "equipment-container-body"
|
|
6201
6234
|
}, 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, {
|
|
6202
|
-
x: uiStore.contextMenu.posX - draggablePosition.x,
|
|
6203
|
-
y: uiStore.contextMenu.posY - draggablePosition.y,
|
|
6235
|
+
x: uiStore.contextMenu.posX - uiStore.draggablePosition.x,
|
|
6236
|
+
y: uiStore.contextMenu.posY - uiStore.draggablePosition.y,
|
|
6204
6237
|
options: uiStore.contextMenu.contextActions,
|
|
6205
6238
|
onSelected: onSelected
|
|
6206
6239
|
}) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React__default.createElement(ItemCard, {
|