@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpg-engine/long-bow",
3
- "version": "0.2.0",
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.8",
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
- ContainerTypes: ItemContainerType | null;
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
- ContainerType: ItemContainerType;
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
- ContainerType,
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={ContainerType}
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
- contextActionMenu = generateContextMenuListOptions(
67
- ActionsForEquipmentSet.Equipment
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) {
@@ -43,7 +43,7 @@ const Template: Story<IEquipmentSetProps> = args => (
43
43
  onMouseOver={onMouseOver}
44
44
  onSelected={onSelected}
45
45
  onItemClick={onItemClick}
46
- ContainerTypes={ItemContainerType.Inventory}
46
+ type={ItemContainerType.Equipment}
47
47
  />
48
48
  </RPGUIRoot>
49
49
  );
@@ -43,7 +43,7 @@ const Template: Story<IItemContainerProps> = () => (
43
43
  onMouseOver={onMouseOver}
44
44
  onSelected={onSelected}
45
45
  onItemClick={onItemClick}
46
- ContainerType={ItemContainerType.Inventory}
46
+ type={ItemContainerType.Inventory}
47
47
  />
48
48
  </RPGUIRoot>
49
49
  );