@rpg-engine/long-bow 0.1.78 → 0.1.79
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 +3 -0
- package/dist/long-bow.cjs.development.js +19 -10
- 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 +19 -10
- 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 +179 -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 +205 -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;
|
|
@@ -6096,6 +6100,10 @@ var UIStore = /*#__PURE__*/function () {
|
|
|
6096
6100
|
this.clearContextMenu();
|
|
6097
6101
|
};
|
|
6098
6102
|
|
|
6103
|
+
_proto.setDraggablePosition = function setDraggablePosition(currentPosition) {
|
|
6104
|
+
this.draggablePosition = _extends({}, currentPosition);
|
|
6105
|
+
};
|
|
6106
|
+
|
|
6099
6107
|
return UIStore;
|
|
6100
6108
|
}();
|
|
6101
6109
|
|
|
@@ -6126,9 +6134,9 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6126
6134
|
var equipmentData = [neck, leftHand, ring, head, armor, legs, boot, inventory, rightHand, accessory];
|
|
6127
6135
|
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!)
|
|
6128
6136
|
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6137
|
+
uiStore.setDraggablePosition(initialPosition); // const [draggablePosition, setDraggablePosition] = useState<IPosition>(
|
|
6138
|
+
// initialPosition
|
|
6139
|
+
// );
|
|
6132
6140
|
|
|
6133
6141
|
var handleOnMouseHover = function handleOnMouseHover(event, slotIndex, item, x, y) {
|
|
6134
6142
|
uiStore.handleOnMouseHover(event, slotIndex, item, x, y, onMouseOver);
|
|
@@ -6176,7 +6184,8 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6176
6184
|
onPositionChange: function onPositionChange(_ref3) {
|
|
6177
6185
|
var x = _ref3.x,
|
|
6178
6186
|
y = _ref3.y;
|
|
6179
|
-
setDraggablePosition({
|
|
6187
|
+
// setDraggablePosition({ x, y });
|
|
6188
|
+
uiStore.setDraggablePosition({
|
|
6180
6189
|
x: x,
|
|
6181
6190
|
y: y
|
|
6182
6191
|
});
|
|
@@ -6188,14 +6197,14 @@ var EquipmentSet = /*#__PURE__*/observer(function (_ref) {
|
|
|
6188
6197
|
}, React.createElement(EquipmentSetContainer, {
|
|
6189
6198
|
className: "equipment-container-body"
|
|
6190
6199
|
}, 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,
|
|
6200
|
+
x: uiStore.contextMenu.posX - uiStore.draggablePosition.x,
|
|
6201
|
+
y: uiStore.contextMenu.posY - uiStore.draggablePosition.y,
|
|
6193
6202
|
options: uiStore.contextMenu.contextActions,
|
|
6194
6203
|
onSelected: onSelected
|
|
6195
6204
|
}) : null, (_uiStore$onHoverDetai = uiStore.onHoverDetail) != null && _uiStore$onHoverDetai.visible ? React.createElement(ItemCard, {
|
|
6196
6205
|
item: uiStore.onHoverDetail.item,
|
|
6197
|
-
x: uiStore.onHoverDetail.posX - draggablePosition.x,
|
|
6198
|
-
y: uiStore.onHoverDetail.posY - draggablePosition.y
|
|
6206
|
+
x: uiStore.onHoverDetail.posX - uiStore.draggablePosition.x,
|
|
6207
|
+
y: uiStore.onHoverDetail.posY - uiStore.draggablePosition.y
|
|
6199
6208
|
}) : null);
|
|
6200
6209
|
});
|
|
6201
6210
|
var EquipmentSetContainer = /*#__PURE__*/styled.div.withConfig({
|