@rpg-engine/long-bow 0.2.0 → 0.2.1
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/Equipment/EquipmentSet.d.ts +1 -1
- package/dist/components/Item/Inventory/ItemContainer.d.ts +1 -1
- package/dist/long-bow.cjs.development.js +10 -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 +10 -3
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Equipment/EquipmentSet.tsx +1 -1
- package/src/components/Item/Inventory/ItemContainer.tsx +3 -3
- package/src/components/Item/Inventory/itemContainerHelper.ts +12 -3
- package/src/stories/EquipmentSet.stories.tsx +1 -1
- package/src/stories/ItemContainer.stories.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpg-engine/long-bow",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@rollup/plugin-image": "^2.1.1",
|
|
86
|
-
"@rpg-engine/shared": "^0.4.
|
|
86
|
+
"@rpg-engine/shared": "^0.4.10",
|
|
87
87
|
"dayjs": "^1.11.2",
|
|
88
88
|
"fs-extra": "^10.1.0",
|
|
89
89
|
"lodash": "^4.17.21",
|
|
@@ -23,7 +23,7 @@ export interface IEquipmentSetProps {
|
|
|
23
23
|
onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
|
|
24
24
|
onSelected?: (optionId: string) => void;
|
|
25
25
|
initialPosition?: { x: number; y: number };
|
|
26
|
-
|
|
26
|
+
type: ItemContainerType | null;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export const EquipmentSet: React.FC<IEquipmentSetProps> = ({
|
|
@@ -15,7 +15,7 @@ export interface IItemContainerProps {
|
|
|
15
15
|
) => void;
|
|
16
16
|
onMouseOver?: (e: any, slotIndex: number, item: IItem | null) => void;
|
|
17
17
|
onSelected?: (optionId: string, item: IItem) => void;
|
|
18
|
-
|
|
18
|
+
type: ItemContainerType;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
export const ItemContainer: React.FC<IItemContainerProps> = ({
|
|
@@ -24,7 +24,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
|
|
|
24
24
|
onMouseOver,
|
|
25
25
|
onSelected,
|
|
26
26
|
onItemClick,
|
|
27
|
-
|
|
27
|
+
type,
|
|
28
28
|
}) => {
|
|
29
29
|
const onRenderSlots = () => {
|
|
30
30
|
const slots = [];
|
|
@@ -35,7 +35,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
|
|
|
35
35
|
key={i}
|
|
36
36
|
slotIndex={i}
|
|
37
37
|
item={itemContainer.slots?.[i] || null}
|
|
38
|
-
itemContainerType={
|
|
38
|
+
itemContainerType={type}
|
|
39
39
|
onMouseOver={(event, slotIndex, item) => {
|
|
40
40
|
if (onMouseOver) onMouseOver(event, slotIndex, item);
|
|
41
41
|
}}
|
|
@@ -63,9 +63,18 @@ export const generateContextMenu = (
|
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
if (itemContainerType === ItemContainerType.Equipment) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
switch (itemType) {
|
|
67
|
+
case ItemType.Container:
|
|
68
|
+
contextActionMenu = generateContextMenuListOptions(
|
|
69
|
+
ActionsForEquipmentSet.Container
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
break;
|
|
73
|
+
default:
|
|
74
|
+
contextActionMenu = generateContextMenuListOptions(
|
|
75
|
+
ActionsForEquipmentSet.Equipment
|
|
76
|
+
);
|
|
77
|
+
}
|
|
69
78
|
}
|
|
70
79
|
if (itemContainerType === ItemContainerType.Loot) {
|
|
71
80
|
switch (itemType) {
|