missing fallback added
This commit is contained in:
1 parent
a1bd168994
commit
c651b767ba
1 file changed
+10
-4
@@ -1,28 +1,34 @@
|
|||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
Inventory = Inventory or {}
|
Inventory = Inventory or {}
|
||||||
|
|
||||||
---This will fallback to framework add item functions when an inventory does not have the specifiec function.
|
---Return the item info in oxs format, {name, label, stack, weight, description, image}
|
||||||
---@param item string
|
---@param item string
|
||||||
---@return table
|
---@return table
|
||||||
Inventory.GetItemInfo = function(item)
|
Inventory.GetItemInfo = function(item)
|
||||||
return Framework.GetItemInfo(item)
|
return Framework.GetItemInfo(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will fallback to framework add item functions when an inventory does not have the specifiec function.
|
---Will return boolean if the player has the item.
|
||||||
---@param item string
|
---@param item string
|
||||||
---@return boolean
|
---@return boolean
|
||||||
Inventory.HasItem = function(item)
|
Inventory.HasItem = function(item)
|
||||||
return Framework.HasItem(item)
|
return Framework.HasItem(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will fallback to framework add item functions when an inventory does not have the specifiec function.
|
---This will return th count of the item in the players inventory, if not found will return 0.
|
||||||
---@param item string
|
---@param item string
|
||||||
---@return number
|
---@return number
|
||||||
Inventory.GetItemCount = function(item)
|
Inventory.GetItemCount = function(item)
|
||||||
return Framework.GetItemCount(item)
|
return Framework.GetItemCount(item)
|
||||||
end
|
end
|
||||||
|
|
||||||
---This will provide a image of the community bridge logo if the inventory isnt bridged for the specific path.
|
---This will return the players inventory in the format of {name, label, count, slot, metadata}
|
||||||
|
---@return table
|
||||||
|
Inventory.GetPlayerInventory = function()
|
||||||
|
return Framework:GetPlayerInventory()
|
||||||
|
end
|
||||||
|
|
||||||
|
---This will get the image path for this item, if not found will return placeholder.
|
||||||
---@param item string
|
---@param item string
|
||||||
---@return string
|
---@return string
|
||||||
Inventory.GetImagePath = function(item)
|
Inventory.GetImagePath = function(item)
|
||||||
|
|||||||
Reference in new issue
Block a user