@rpg-engine/long-bow 0.1.78 → 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/LICENSE +20 -20
- package/README.md +181 -181
- package/dist/components/store/UI.store.d.ts +4 -0
- package/dist/long-bow.cjs.development.js +48 -6
- 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 +48 -6
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +96 -96
- package/src/components/Abstractions/SlotsContainer.tsx +42 -42
- package/src/components/Button.tsx +29 -29
- package/src/components/Chat/Chat.tsx +193 -193
- package/src/components/CheckButton.tsx +65 -65
- package/src/components/DraggableContainer.tsx +150 -150
- package/src/components/Dropdown.tsx +57 -57
- package/src/components/Equipment/EquipmentSet.tsx +180 -179
- package/src/components/Input.tsx +11 -11
- package/src/components/Item/Cards/ItemCard.tsx +36 -36
- package/src/components/Item/Inventory/ItemContainer.tsx +113 -113
- package/src/components/Item/Inventory/ItemSlot.tsx +158 -158
- package/src/components/Item/Inventory/itemContainerHelper.ts +81 -81
- package/src/components/ListMenu.tsx +65 -65
- package/src/components/Multitab/Tab.tsx +57 -57
- package/src/components/Multitab/TabBody.tsx +13 -13
- package/src/components/Multitab/TabsContainer.tsx +97 -97
- package/src/components/NPCDialog/NPCDialog.tsx +145 -145
- package/src/components/NPCDialog/NPCDialogText.tsx +53 -53
- package/src/components/NPCDialog/QuestionDialog/QuestionDialog.tsx +242 -242
- package/src/components/ProgressBar.tsx +91 -91
- package/src/components/RPGUIContainer.tsx +47 -47
- package/src/components/RPGUIRoot.tsx +14 -14
- package/src/components/RadioButton.tsx +53 -53
- package/src/components/RangeSlider.tsx +68 -68
- package/src/components/ScrollList.tsx +77 -77
- package/src/components/SimpleProgressBar.tsx +62 -62
- package/src/components/SkillProgressBar.tsx +124 -124
- package/src/components/SkillsContainer.tsx +235 -235
- package/src/components/TextArea.tsx +11 -11
- package/src/components/Truncate.tsx +25 -25
- package/src/components/shared/Column.tsx +16 -16
- package/src/components/shared/SpriteFromAtlas.tsx +99 -99
- package/src/components/shared/SpriteIcon.tsx +67 -67
- package/src/components/store/UI.store.ts +232 -192
- package/src/components/typography/DynamicText.tsx +49 -49
- package/src/constants/uiColors.ts +10 -10
- package/src/hooks/useEventListener.ts +21 -21
- package/src/hooks/useOutsideAlerter.ts +25 -25
- package/src/index.tsx +25 -25
- package/src/libs/StringHelpers.ts +3 -3
- package/src/mocks/atlas/icons/icons.json +303 -303
- package/src/mocks/atlas/items/items.json +5195 -5195
- package/src/mocks/equipmentSet.mocks.ts +347 -347
- package/src/mocks/itemContainer.mocks.ts +249 -249
- package/src/mocks/skills.mocks.ts +122 -122
- package/src/types/eventTypes.ts +4 -4
- package/src/types/index.d.ts +2 -2
package/dist/long-bow.esm.js
CHANGED
|
@@ -11,7 +11,7 @@ import { observer } from 'mobx-react';
|
|
|
11
11
|
import { makeAutoObservable, toJS } from 'mobx';
|
|
12
12
|
|
|
13
13
|
function _extends() {
|
|
14
|
-
_extends = Object.assign
|
|
14
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
15
15
|
for (var i = 1; i < arguments.length; i++) {
|
|
16
16
|
var source = arguments[i];
|
|
17
17
|
|
|
@@ -24,7 +24,6 @@ function _extends() {
|
|
|
24
24
|
|
|
25
25
|
return target;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
27
|
return _extends.apply(this, arguments);
|
|
29
28
|
}
|
|
30
29
|
|
|
@@ -5975,6 +5974,10 @@ var initialHoverState = {
|
|
|
5975
5974
|
posY: 0,
|
|
5976
5975
|
item: null
|
|
5977
5976
|
};
|
|
5977
|
+
var initialPosition = {
|
|
5978
|
+
x: 0,
|
|
5979
|
+
y: 0
|
|
5980
|
+
};
|
|
5978
5981
|
|
|
5979
5982
|
var UIStore = /*#__PURE__*/function () {
|
|
5980
5983
|
function UIStore() {
|
|
@@ -5982,6 +5985,7 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
5982
5985
|
|
|
5983
5986
|
this.contextMenu = initialState;
|
|
5984
5987
|
this.onHoverDetail = initialHoverState;
|
|
5988
|
+
this.draggablePosition = initialPosition;
|
|
5985
5989
|
|
|
5986
5990
|
this.handleOnItemClick = function (item, posX, posY, slotContainerType) {
|
|
5987
5991
|
var _this$contextMenu;
|
|
@@ -5994,6 +5998,8 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
5994
5998
|
return;
|
|
5995
5999
|
}
|
|
5996
6000
|
|
|
6001
|
+
_this.setDraggablePosition(_this.getOffsets());
|
|
6002
|
+
|
|
5997
6003
|
switch (slotContainerType) {
|
|
5998
6004
|
case SlotContainerType.EQUIPMENT_SET:
|
|
5999
6005
|
_this.setEquipContextMenu({
|
|
@@ -6030,6 +6036,8 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6030
6036
|
|
|
6031
6037
|
this.handleOnMouseHover = function (event, slotIndex, item, posX, posY, onMouseOver) {
|
|
6032
6038
|
if (item) {
|
|
6039
|
+
_this.setDraggablePosition(_this.getOffsets());
|
|
6040
|
+
|
|
6033
6041
|
_this.setItemHoverDetail({
|
|
6034
6042
|
visible: true,
|
|
6035
6043
|
posX: posX,
|
|
@@ -6043,6 +6051,34 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6043
6051
|
}
|
|
6044
6052
|
};
|
|
6045
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
|
+
|
|
6046
6082
|
makeAutoObservable(this);
|
|
6047
6083
|
}
|
|
6048
6084
|
|
|
@@ -6096,6 +6132,10 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6096
6132
|
this.clearContextMenu();
|
|
6097
6133
|
};
|
|
6098
6134
|
|
|
6135
|
+
_proto.setDraggablePosition = function setDraggablePosition(currentPosition) {
|
|
6136
|
+
this.draggablePosition = _extends({}, currentPosition);
|
|
6137
|
+
};
|
|
6138
|
+
|
|
6099
6139
|
return UIStore;
|
|
6100
6140
|
}();
|
|
6101
6141
|
|
|
@@ -6125,6 +6165,7 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6125
6165
|
accessory = equipmentSet.accessory;
|
|
6126
6166
|
var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
|
|
6127
6167
|
var equipmentMaskSlots = [ItemSlotType.Neck, ItemSlotType.LeftHand, ItemSlotType.Ring, ItemSlotType.Head, ItemSlotType.Torso, ItemSlotType.Legs, ItemSlotType.Feet, ItemSlotType.Inventory, ItemSlotType.RightHand, ItemSlotType.Accessory]; // we use this draggable position to offset the menu position, after the container is dragged (otherwise, it bugs!)
|
|
6168
|
+
// uiStore.setDraggablePosition(initialPosition)
|
|
6128
6169
|
|
|
6129
6170
|
var _useState = useState(initialPosition),
|
|
6130
6171
|
draggablePosition = _useState[0],
|
|
@@ -6180,6 +6221,7 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6180
6221
|
x: x,
|
|
6181
6222
|
y: y
|
|
6182
6223
|
});
|
|
6224
|
+
console.log(draggablePosition);
|
|
6183
6225
|
},
|
|
6184
6226
|
onOutsideClick: function onOutsideClick() {
|
|
6185
6227
|
uiStore.clearContextMenu();
|
|
@@ -6188,14 +6230,14 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6188
6230
|
}, React.createElement(EquipmentSetContainer, {
|
|
6189
6231
|
className: "equipment-container-body"
|
|
6190
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, {
|
|
6191
|
-
x: uiStore.contextMenu.posX - draggablePosition.x,
|
|
6192
|
-
y: uiStore.contextMenu.posY - draggablePosition.y,
|
|
6233
|
+
x: uiStore.contextMenu.posX - uiStore.draggablePosition.x,
|
|
6234
|
+
y: uiStore.contextMenu.posY - uiStore.draggablePosition.y,
|
|
6193
6235
|
options: uiStore.contextMenu.contextActions,
|
|
6194
6236
|
onSelected: onSelected
|
|
6195
6237
|
}) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React.createElement(ItemCard, {
|
|
6196
6238
|
item: uiStore.onHoverDetail.item,
|
|
6197
|
-
x: uiStore.onHoverDetail.posX
|
|
6198
|
-
y: uiStore.onHoverDetail.posY
|
|
6239
|
+
x: uiStore.onHoverDetail.posX,
|
|
6240
|
+
y: uiStore.onHoverDetail.posY
|
|
6199
6241
|
}) : null);
|
|
6200
6242
|
});
|
|
6201
6243
|
var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
|