cachedItemList

This commit is contained in:
MrNewb committed 2025-07-09 22:17:24 -04:00
1 parent 2cb847c8cd
commit 58ab40d14e
2 files changed
+9 -2

No files matched your search

+5 -1
View File
@@ -8,6 +8,8 @@ ESX = exports["es_extended"]:getSharedObject()
Framework = Framework or {}
local cachedItemList = nil
---This will return the name of the framework in use.
---@return string
Framework.GetFrameworkName = function()
@@ -16,6 +18,7 @@ end
-- This is an internal function, its here to attempt to emulate qbs shared items mainly.
Framework.ItemList = function()
if cachedItemList then return cachedItemList end
local items = ESX.Items
local repackedTable = {}
for k, v in pairs(items) do
@@ -33,7 +36,8 @@ Framework.ItemList = function()
}
end
end
return { Items = repackedTable or {} }
cachedItemList = { Items = repackedTable or {} }
return cachedItemList
end
---This will return if the player is an admin in the framework.