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
function isInventoryOpen()
if isStarted(OXInv) then
return LocalPlayer.state.invBusy
elseif isStarted(QSInv) then
return exports[QSInv]:inInventory()
return IsNuiFocused()
elseif isStarted(OrigenInv) then
return exports[OrigenInv]:IsInventoryOpen()
--if isStarted(OXInv) then
-- return LocalPlayer.state.invBusy
elseif isStarted(CoreInv) then
return exports[CoreInv]:isInventoryOpen()
--elseif isStarted(QSInv) then
-- return exports[QSInv]:inInventory()
elseif isStarted(CodeMInv) then
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(OrigenInv) then
-- return exports[OrigenInv]:IsInventoryOpen()
elseif isStarted(TgiannInv) then
return exports[TgiannInv]:IsInventoryActive()
--elseif isStarted(CoreInv) then
-- return exports[CoreInv]:isInventoryOpen()
elseif isStarted(QBInv) then
return LocalPlayer.state.inv_busy
--elseif isStarted(CodeMInv) then
-- 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
return LocalPlayer.state.inv_busy
--elseif isStarted(TgiannInv) then
-- return IsNuiFocused()
elseif ESX and isStarted(ESXExport) then
return false
--elseif isStarted(QBInv) then
-- 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
-------------------------------------------------------------