HasItem + partial support for shops

This commit is contained in:
MrNewb committed 2025-03-07 04:08:40 -05:00
1 parent f28e511de6
commit dee14600ba
14 files changed
+220 -7

No files matched your search

+10 -1
View File
@@ -60,6 +60,14 @@ Inventory.SetMetadata = function(src, item, slot, metadata)
return codem:SetItemMetadata(src, slot, metadata)
end
---comment
---@param src number
---@param item string
---@return boolean
Inventory.HasItem = function(src, item)
return codem:HasItem(src, item, 1)
end
Inventory.GetItemBySlot = function(src, slot)
local slotData = codem:GetItemBySlot(src, slot)
if not slotData then return {} end
@@ -81,4 +89,5 @@ Inventory.GetImagePath = function(item)
local file = LoadResourceFile("codem-inventory", string.format("html/images/%s.png", item))
local imagePath = file and string.format("nui://codem-inventory/html/images/%s.png", item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
end