From a507ec6a3195e6182848cf375d0fdc384eca5011 Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Mon, 27 Jul 2026 04:20:19 +0200 Subject: [PATCH] fix(esx_inventory/client): stop overloading the menu usable flag esx_menu_default treats usable == false as "this row cannot be submitted". esx_inventory was filling the same field with its own meaning - whether an item has a use callback - and set it to false for accounts, for weapons and for every item without a registered callback. The result was that pressing enter on cash, bank, dirty money, any weapon or any non consumable item did nothing at all. buildItemActionMenu was never reached, even though those entries carry canRemove and the submenu would have offered give and throw. The action menu needs the value for its own "use" entry, so it moves to a separate canUse field. The weight row keeps usable = false, since not being submittable is correct there. Verified on artifact 25770. Before: enter on cash and on bread did nothing. After: cash offers throw and return, bank offers only return because it is not droppable, bread offers throw and return without a use entry, and the weight row still cannot be selected. --- [core]/esx_inventory/client/main.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/[core]/esx_inventory/client/main.lua b/[core]/esx_inventory/client/main.lua index 3fd84785..5ea57564 100644 --- a/[core]/esx_inventory/client/main.lua +++ b/[core]/esx_inventory/client/main.lua @@ -4,7 +4,8 @@ ---@field icon string ---@field count number ---@field value string ----@field usable boolean +---@field canUse boolean? +---@field usable boolean? ---@field rare boolean ---@field canRemove boolean ---@field unselectable boolean? @@ -34,7 +35,6 @@ local function appendAccounts(elements) icon = "fas fa-money-bill-wave", count = account.money, value = account.name, - usable = false, rare = false, canRemove = canDrop } @@ -56,7 +56,7 @@ local function appendItems(elements) icon = "fas fa-box", count = item.count, value = item.name, - usable = item.usable, + canUse = item.usable, rare = item.rare, canRemove = item.canRemove } @@ -83,7 +83,6 @@ local function appendLoadout(elements) icon = "fas fa-gun", count = 1, value = weapon.name, - usable = false, rare = false, ammo = ammo, canGiveAmmo = (weapon.ammo ~= nil), @@ -119,7 +118,7 @@ end ---@return table local function buildItemActionMenu(selected, playerNearby) local elements2 = {} - if selected.usable then + if selected.canUse then elements2[#elements2 + 1] = { action = "use", label = TranslateCap("use"), icon = "fas fa-utensils", type = selected.type, value = selected.value } end if selected.canRemove then