@rpg-engine/long-bow 0.8.110 → 0.8.111

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.
@@ -27772,19 +27772,30 @@ var generateContextMenu = function generateContextMenu(item, itemContainerType,
27772
27772
  contextActionMenu = generateContextMenuListOptions(ActionsForLoot.Other);
27773
27773
  break;
27774
27774
  }
27775
- // Add "Use" for consumable items in nested containers (same as Inventory)
27776
- if (item.type === ItemType.Consumable) {
27777
- contextActionMenu.unshift({
27778
- id: ItemSocketEvents.Use,
27779
- text: ItemSocketEventsDisplayLabels[ItemSocketEvents.Use]
27775
+ // Add "Use" for usable items in nested containers (same as Inventory)
27776
+ // Check both item type and isUsable flag to handle all usable items
27777
+ if (item.type === ItemType.Consumable || item.isUsable) {
27778
+ var hasUseAction = contextActionMenu.some(function (action) {
27779
+ return action.id === ItemSocketEvents.Use;
27780
27780
  });
27781
+ if (!hasUseAction) {
27782
+ contextActionMenu.unshift({
27783
+ id: ItemSocketEvents.Use,
27784
+ text: ItemSocketEventsDisplayLabels[ItemSocketEvents.Use]
27785
+ });
27786
+ }
27781
27787
  }
27782
27788
  // Add "Use with..." for items that have hasUseWith property
27783
27789
  if (item.hasUseWith) {
27784
- contextActionMenu.push({
27785
- id: ItemSocketEvents.UseWith,
27786
- text: ItemSocketEvents.UseWith
27790
+ var hasUseWithAction = contextActionMenu.some(function (action) {
27791
+ return action.id === ItemSocketEvents.UseWith;
27787
27792
  });
27793
+ if (!hasUseWithAction) {
27794
+ contextActionMenu.push({
27795
+ id: ItemSocketEvents.UseWith,
27796
+ text: ItemSocketEvents.UseWith
27797
+ });
27798
+ }
27788
27799
  }
27789
27800
  }
27790
27801
  if (itemContainerType === ItemContainerType.MapContainer) {
@@ -27808,14 +27819,29 @@ var generateContextMenu = function generateContextMenu(item, itemContainerType,
27808
27819
  contextActionMenu = generateContextMenuListOptions(ActionsForMapContainer.Other);
27809
27820
  break;
27810
27821
  }
27811
- var _contextActionMenuDontHaveUseWith = !contextActionMenu.find(function (action) {
27812
- return action.text.toLowerCase().includes('use with');
27813
- });
27814
- if (item.hasUseWith && _contextActionMenuDontHaveUseWith) {
27815
- contextActionMenu.push({
27816
- id: 'use-with',
27817
- text: 'Use with...'
27822
+ // Add "Use" for usable items (same logic as Loot containers)
27823
+ if (item.type === ItemType.Consumable || item.isUsable) {
27824
+ var _hasUseAction = contextActionMenu.some(function (action) {
27825
+ return action.id === ItemSocketEvents.Use;
27826
+ });
27827
+ if (!_hasUseAction) {
27828
+ contextActionMenu.unshift({
27829
+ id: ItemSocketEvents.Use,
27830
+ text: ItemSocketEventsDisplayLabels[ItemSocketEvents.Use]
27831
+ });
27832
+ }
27833
+ }
27834
+ // Add "Use with..." for items that have hasUseWith property
27835
+ if (item.hasUseWith) {
27836
+ var _hasUseWithAction = contextActionMenu.some(function (action) {
27837
+ return action.id === ItemSocketEvents.UseWith;
27818
27838
  });
27839
+ if (!_hasUseWithAction) {
27840
+ contextActionMenu.push({
27841
+ id: ItemSocketEvents.UseWith,
27842
+ text: ItemSocketEvents.UseWith
27843
+ });
27844
+ }
27819
27845
  }
27820
27846
  }
27821
27847
  if (itemContainerType === ItemContainerType.Depot) {