@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.
@@ -1,4 +1,5 @@
1
1
  import { ItemType } from '@rpg-engine/shared';
2
+ import { SlotContainerType } from './ItemContainerTypes';
2
3
  export interface IContextMenuItem {
3
4
  id: string;
4
5
  text: string;
@@ -7,5 +8,5 @@ export declare enum ContainerType {
7
8
  INVENTORY = "Inventory",
8
9
  EQUIPMENT_SET = "EquipmentSet"
9
10
  }
10
- export declare const handleContextMenuList: (itemType: ItemType) => IContextMenuItem[];
11
+ export declare const handleContextMenuList: (itemType: ItemType, slotContainerType: SlotContainerType | null) => IContextMenuItem[];
11
12
  export declare const handleEquipmentContextMenuList: (itemType: ItemType) => IContextMenuItem[];
@@ -5827,7 +5827,8 @@ var generateContextList = function generateContextList(actionsByTypeList) {
5827
5827
  });
5828
5828
  return contextMenu;
5829
5829
  };
5830
- var handleEquipmentContextMenuList = function handleEquipmentContextMenuList(itemType) {
5830
+
5831
+ var handleContextMenuList = function handleContextMenuList(itemType, slotContainerType) {
5831
5832
  var contextActionMenu = [];
5832
5833
 
5833
5834
  switch (itemType) {
@@ -5836,15 +5837,31 @@ var handleEquipmentContextMenuList = function handleEquipmentContextMenuList(ite
5836
5837
  case shared.ItemType.Accessory:
5837
5838
  case shared.ItemType.Jewelry:
5838
5839
  case shared.ItemType.Tool:
5839
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
5840
+ if (slotContainerType === SlotContainerType.EQUIPMENT_SET) {
5841
+ contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmentSetItems);
5842
+ } else {
5843
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
5844
+ }
5845
+
5846
+ break;
5847
+
5848
+ case shared.ItemType.Consumable:
5849
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Consumable);
5850
+ break;
5851
+
5852
+ case shared.ItemType.CraftMaterial:
5853
+ contextActionMenu = generateContextList(shared.ActionsByItemType.CraftMaterial);
5840
5854
  break;
5841
5855
 
5856
+ case shared.ItemType.Other:
5857
+ case shared.ItemType.Information:
5858
+ case shared.ItemType.Quest:
5842
5859
  case shared.ItemType.Container:
5843
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetContainer);
5860
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
5844
5861
  break;
5845
5862
 
5846
5863
  default:
5847
- contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmenSetItems);
5864
+ contextActionMenu = generateContextList(shared.ActionsByItemType.Other);
5848
5865
  break;
5849
5866
  }
5850
5867
 
@@ -5887,7 +5904,7 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
5887
5904
 
5888
5905
  React.useEffect(function () {
5889
5906
  if (item) {
5890
- setContextActions(handleEquipmentContextMenuList(item.type));
5907
+ setContextActions(handleContextMenuList(item.type, slotContainerType));
5891
5908
  }
5892
5909
  }, [item]);
5893
5910