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