@rpg-engine/long-bow 0.2.51 → 0.2.52
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/ItemContainer.d.ts +1 -0
- package/dist/components/Item/Inventory/ItemSlot.d.ts +1 -0
- 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/ItemContainer.tsx +3 -0
- package/src/components/Item/Inventory/ItemSlot.tsx +3 -1
package/package.json
CHANGED
|
@@ -18,6 +18,7 @@ export interface IItemContainerProps {
|
|
|
18
18
|
type: ItemContainerType;
|
|
19
19
|
atlasJSON: any;
|
|
20
20
|
atlasIMG: any;
|
|
21
|
+
disableContextMenu?: boolean;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export const ItemContainer: React.FC<IItemContainerProps> = ({
|
|
@@ -29,6 +30,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
|
|
|
29
30
|
type,
|
|
30
31
|
atlasJSON,
|
|
31
32
|
atlasIMG,
|
|
33
|
+
disableContextMenu = false,
|
|
32
34
|
}) => {
|
|
33
35
|
const onRenderSlots = () => {
|
|
34
36
|
const slots = [];
|
|
@@ -36,6 +38,7 @@ export const ItemContainer: React.FC<IItemContainerProps> = ({
|
|
|
36
38
|
for (let i = 0; i < itemContainer.slotQty; i++) {
|
|
37
39
|
slots.push(
|
|
38
40
|
<ItemSlot
|
|
41
|
+
isContextMenuDisabled={disableContextMenu}
|
|
39
42
|
key={i}
|
|
40
43
|
slotIndex={i}
|
|
41
44
|
item={itemContainer.slots?.[i] || null}
|
|
@@ -54,6 +54,7 @@ interface IProps {
|
|
|
54
54
|
) => void;
|
|
55
55
|
atlasJSON: any;
|
|
56
56
|
atlasIMG: any;
|
|
57
|
+
isContextMenuDisabled?: boolean;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
export const ItemSlot: React.FC<IProps> = observer(
|
|
@@ -68,6 +69,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
68
69
|
onSelected,
|
|
69
70
|
atlasJSON,
|
|
70
71
|
atlasIMG,
|
|
72
|
+
isContextMenuDisabled = false,
|
|
71
73
|
}) => {
|
|
72
74
|
const [isTooltipVisible, setTooltipVisible] = useState(false);
|
|
73
75
|
|
|
@@ -207,7 +209,7 @@ export const ItemSlot: React.FC<IProps> = observer(
|
|
|
207
209
|
}
|
|
208
210
|
}}
|
|
209
211
|
>
|
|
210
|
-
{isContextMenuVisible && contextActions && (
|
|
212
|
+
{!isContextMenuDisabled && isContextMenuVisible && contextActions && (
|
|
211
213
|
<RelativeListMenu
|
|
212
214
|
options={contextActions}
|
|
213
215
|
onSelected={(optionId: string) => {
|