start to doc functs

This commit is contained in:
MrNewb committed 2025-03-03 01:09:24 -05:00
1 parent 269fe5dcb6
commit 83b982c400
18 files changed
+426 -3

No files matched your search

+11
View File
@@ -3,6 +3,9 @@ local ox_inventory = exports.ox_inventory
Inventory = Inventory or {}
---comment
---@param item string
---@return table
Inventory.GetItemInfo = function(item)
local itemData = ox_inventory:Items(item)
if not itemData then return {} end
@@ -17,18 +20,26 @@ Inventory.GetItemInfo = function(item)
return repackedTable
end
---comment
---@param item string
---@return boolean
Inventory.HasItem = function(item)
local itemCount = ox_inventory:Search('count', item)
local hasItem = itemCount ~= 0
return hasItem
end
---comment
---@param item string
---@return string
Inventory.GetImagePath = function(item)
local file = LoadResourceFile("ox_inventory", string.format("web/images/%s.png", item))
local imagePath = file and string.format("nui://ox_inventory/web/images/%s.png", item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
---comment
---@return table
Inventory.GetPlayerInventory = function()
return exports.ox_inventory:GetPlayerItems()
end