@rpg-engine/long-bow 0.1.94 → 0.1.96
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/Item/Inventory/itemContainerHelper.d.ts +2 -1
- package/dist/long-bow.cjs.development.js +8 -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 +8 -3
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemSlot.tsx +1 -1
- package/src/components/Item/Inventory/itemContainerHelper.ts +8 -3
|
@@ -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[];
|
|
@@ -5828,7 +5828,7 @@ var generateContextList = function generateContextList(actionsByTypeList) {
|
|
|
5828
5828
|
return contextMenu;
|
|
5829
5829
|
};
|
|
5830
5830
|
|
|
5831
|
-
var handleContextMenuList = function handleContextMenuList(itemType) {
|
|
5831
|
+
var handleContextMenuList = function handleContextMenuList(itemType, slotContainerType) {
|
|
5832
5832
|
var contextActionMenu = [];
|
|
5833
5833
|
|
|
5834
5834
|
switch (itemType) {
|
|
@@ -5837,7 +5837,12 @@ var handleContextMenuList = function handleContextMenuList(itemType) {
|
|
|
5837
5837
|
case shared.ItemType.Accessory:
|
|
5838
5838
|
case shared.ItemType.Jewelry:
|
|
5839
5839
|
case shared.ItemType.Tool:
|
|
5840
|
-
|
|
5840
|
+
if (slotContainerType === SlotContainerType.EQUIPMENT_SET) {
|
|
5841
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.EquipmentSetItems);
|
|
5842
|
+
} else {
|
|
5843
|
+
contextActionMenu = generateContextList(shared.ActionsByItemType.Equipment);
|
|
5844
|
+
}
|
|
5845
|
+
|
|
5841
5846
|
break;
|
|
5842
5847
|
|
|
5843
5848
|
case shared.ItemType.Consumable:
|
|
@@ -5899,7 +5904,7 @@ var ItemSlot = /*#__PURE__*/mobxReactLite.observer(function (_ref) {
|
|
|
5899
5904
|
|
|
5900
5905
|
React.useEffect(function () {
|
|
5901
5906
|
if (item) {
|
|
5902
|
-
setContextActions(handleContextMenuList(item.type));
|
|
5907
|
+
setContextActions(handleContextMenuList(item.type, slotContainerType));
|
|
5903
5908
|
}
|
|
5904
5909
|
}, [item]);
|
|
5905
5910
|
|