Unify isInventoryOpen() function

This should fix issues for crafting complaining inventories are open when they aren't

I was trying to use per inventory checks for them being open until I realised I could just use `IsNuiFocused()` for all inventories to check if there was an nui on the screen that used the mouse, this should be a good workaround for it
This commit is contained in:
Jim Shield
2025-06-04 13:53:49 +01:00
parent 3ca2da2990
commit 76c34b8c03

View File

@@ -176,39 +176,44 @@ function getPlayerInv(src)
end end
function isInventoryOpen() function isInventoryOpen()
if isStarted(OXInv) then
return LocalPlayer.state.invBusy
elseif isStarted(QSInv) then return IsNuiFocused()
return exports[QSInv]:inInventory()
elseif isStarted(OrigenInv) then --if isStarted(OXInv) then
return exports[OrigenInv]:IsInventoryOpen() -- return LocalPlayer.state.invBusy
elseif isStarted(CoreInv) then --elseif isStarted(QSInv) then
return exports[CoreInv]:isInventoryOpen() -- return exports[QSInv]:inInventory()
elseif isStarted(CodeMInv) then --elseif isStarted(OrigenInv) then
return false -- return exports[OrigenInv]:IsInventoryOpen()
-- CodeM doesn't have a function to check if the inventory is open
-- No idea what it uses, so it just skips the check
elseif isStarted(TgiannInv) then --elseif isStarted(CoreInv) then
return exports[TgiannInv]:IsInventoryActive() -- return exports[CoreInv]:isInventoryOpen()
elseif isStarted(QBInv) then --elseif isStarted(CodeMInv) then
return LocalPlayer.state.inv_busy -- return false
-- -- CodeM doesn't have a function to check if the inventory is open
-- -- No idea what it uses, so it just skips the check
elseif isStarted(PSInv) then --elseif isStarted(TgiannInv) then
return LocalPlayer.state.inv_busy -- return IsNuiFocused()
elseif ESX and isStarted(ESXExport) then --elseif isStarted(QBInv) then
return false -- return LocalPlayer.state.inv_busy
--elseif isStarted(PSInv) then
-- return LocalPlayer.state.inv_busy
--elseif ESX and isStarted(ESXExport) then
-- return false
--elseif isStarted(RSGInv) then
-- return LocalPlayer.state.inv_busy
--end
elseif isStarted(RSGInv) then
return LocalPlayer.state.inv_busy
end
end end
------------------------------------------------------------- -------------------------------------------------------------