@rpg-engine/long-bow 0.1.93 → 0.1.97

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.1.93",
3
+ "version": "0.1.97",
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.3.67",
86
+ "@rpg-engine/shared": "^0.3.98",
87
87
  "dayjs": "^1.11.2",
88
88
  "fs-extra": "^10.1.0",
89
89
  "lodash": "^4.17.21",
@@ -8,10 +8,7 @@ import atlasIMG from '../../../mocks/atlas/items/items.png';
8
8
  import { RelativeListMenu } from '../../RelativeListMenu';
9
9
  import { SpriteFromAtlas } from '../../shared/SpriteFromAtlas';
10
10
  import { ItemTooltip } from '../Cards/ItemTooltip';
11
- import {
12
- handleEquipmentContextMenuList,
13
- IContextMenuItem,
14
- } from './itemContainerHelper';
11
+ import { handleContextMenuList, IContextMenuItem } from './itemContainerHelper';
15
12
  import { SlotContainerType } from './ItemContainerTypes';
16
13
 
17
14
  const EquipmentSlotSpriteByType: any = {
@@ -66,7 +63,7 @@ export const ItemSlot: React.FC<IProps> = observer(
66
63
 
67
64
  useEffect(() => {
68
65
  if (item) {
69
- setContextActions(handleEquipmentContextMenuList(item.type));
66
+ setContextActions(handleContextMenuList(item.type, slotContainerType));
70
67
  }
71
68
  }, [item]);
72
69
 
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  ActionsByItemType,
3
3
  ItemSocketEventsDisplayLabels,
4
- ItemType,
4
+ ItemType
5
5
  } from '@rpg-engine/shared';
6
+ import { SlotContainerType } from './ItemContainerTypes';
6
7
 
7
8
  export interface IContextMenuItem {
8
9
  id: string;
@@ -24,7 +25,7 @@ const generateContextList = (actionsByTypeList: any) => {
24
25
  return contextMenu;
25
26
  };
26
27
 
27
- export const handleContextMenuList = (itemType: ItemType) => {
28
+ export const handleContextMenuList = (itemType: ItemType, slotContainerType: SlotContainerType | null) => {
28
29
  let contextActionMenu: IContextMenuItem[] = [];
29
30
 
30
31
  switch (itemType) {
@@ -33,7 +34,11 @@ export const handleContextMenuList = (itemType: ItemType) => {
33
34
  case ItemType.Accessory:
34
35
  case ItemType.Jewelry:
35
36
  case ItemType.Tool:
36
- contextActionMenu = generateContextList(ActionsByItemType.Equipment);
37
+ if (slotContainerType === SlotContainerType.EQUIPMENT_SET) {
38
+ contextActionMenu = generateContextList(ActionsByItemType.EquipmentSetItems);
39
+ } else {
40
+ contextActionMenu = generateContextList(ActionsByItemType.Equipment);
41
+ }
37
42
  break;
38
43
  case ItemType.Consumable:
39
44
  contextActionMenu = generateContextList(ActionsByItemType.Consumable);
@@ -63,17 +68,17 @@ export const handleEquipmentContextMenuList = (itemType: ItemType) => {
63
68
  case ItemType.Jewelry:
64
69
  case ItemType.Tool:
65
70
  contextActionMenu = generateContextList(
66
- ActionsByItemType.EquipmenSetItems
71
+ ActionsByItemType.EquipmentSetItems
67
72
  );
68
73
  break;
69
74
  case ItemType.Container:
70
75
  contextActionMenu = generateContextList(
71
- ActionsByItemType.EquipmenSetContainer
76
+ ActionsByItemType.EquipmentSetContainer
72
77
  );
73
78
  break;
74
79
  default:
75
80
  contextActionMenu = generateContextList(
76
- ActionsByItemType.EquipmenSetItems
81
+ ActionsByItemType.EquipmentSetItems
77
82
  );
78
83
  break;
79
84
  }