diff --git a/modules/inventory/_default/client.lua b/modules/inventory/_default/client.lua index 7f460c5..fbe8df5 100644 --- a/modules/inventory/_default/client.lua +++ b/modules/inventory/_default/client.lua @@ -42,4 +42,10 @@ Inventory.StripPNG = function(item) return item end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + return Inventory \ No newline at end of file diff --git a/modules/inventory/_default/server.lua b/modules/inventory/_default/server.lua index e98fb18..65903b9 100644 --- a/modules/inventory/_default/server.lua +++ b/modules/inventory/_default/server.lua @@ -51,6 +51,12 @@ Inventory.GetItemInfo = function(item) return Framework.GetItemInfo(item) end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---This will return the count of the item in the players inventory, if not found will return 0. ---if metadata is passed it will find the matching items count. ---example: 0 diff --git a/modules/inventory/codem-inventory/client.lua b/modules/inventory/codem-inventory/client.lua index ffe00a5..7c34524 100644 --- a/modules/inventory/codem-inventory/client.lua +++ b/modules/inventory/codem-inventory/client.lua @@ -21,6 +21,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return codem:GetItemList() +end + ---This will get the image path for this item, if not found will return placeholder. ---@param item string ---@return string diff --git a/modules/inventory/codem-inventory/server.lua b/modules/inventory/codem-inventory/server.lua index f80c7a3..fc652f9 100644 --- a/modules/inventory/codem-inventory/server.lua +++ b/modules/inventory/codem-inventory/server.lua @@ -46,6 +46,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return codem:GetItemList() +end + ---This wil return the players inventory. ---@param src number ---@return table diff --git a/modules/inventory/core_inventory/client.lua b/modules/inventory/core_inventory/client.lua index ffa4b4c..214f728 100644 --- a/modules/inventory/core_inventory/client.lua +++ b/modules/inventory/core_inventory/client.lua @@ -24,6 +24,24 @@ Inventory.GetItemInfo = function(item) return {name = dataRepack.name, label = dataRepack.label, stack = dataRepack.stack, weight = dataRepack.weight, description = dataRepack.description, image = Inventory.GetImagePath(dataRepack.name) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + local frameworkName = Framework.GetFrameworkName() + if not frameworkName then return {} end + local dataRepack = {} + if frameworkName == 'es_extended' then + local callbackData = Callback.Trigger('community_bridge:Callback:core_inventory', false) + -- really really wish this inventory allowed me to pull the item list client side.... + dataRepack = callbackData + if not dataRepack then return {} end + elseif frameworkName == 'qb-core' then + dataRepack = Framework.Shared.Items + if not dataRepack then return {} end + end + return dataRepack +end + ---Will return boolean if the player has the item. ---@param item string ---@return boolean diff --git a/modules/inventory/core_inventory/server.lua b/modules/inventory/core_inventory/server.lua index b35868c..9d0956d 100644 --- a/modules/inventory/core_inventory/server.lua +++ b/modules/inventory/core_inventory/server.lua @@ -251,4 +251,10 @@ Callback.Register('community_bridge:Callback:core_inventory', function(source) return items or {} end) +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return core:getItemsList() +end + return Inventory \ No newline at end of file diff --git a/modules/inventory/jpr-inventory/client.lua b/modules/inventory/jpr-inventory/client.lua index 34fc32d..e2448dc 100644 --- a/modules/inventory/jpr-inventory/client.lua +++ b/modules/inventory/jpr-inventory/client.lua @@ -27,6 +27,12 @@ Inventory.HasItem = function(item) return jpr:HasItem(item) end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---This will get the image path for this item, if not found will return placeholder. ---@param item string ---@return string diff --git a/modules/inventory/jpr-inventory/server.lua b/modules/inventory/jpr-inventory/server.lua index 53fdefb..c46ae2a 100644 --- a/modules/inventory/jpr-inventory/server.lua +++ b/modules/inventory/jpr-inventory/server.lua @@ -40,6 +40,12 @@ Inventory.GetItemInfo = function(item) return itemTable end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---Returns the specified slot data as a table. ---format {weight, name, metadata, slot, label, count} ---@param src number diff --git a/modules/inventory/origen_inventory/client.lua b/modules/inventory/origen_inventory/client.lua index 06f6b09..77d7adb 100644 --- a/modules/inventory/origen_inventory/client.lua +++ b/modules/inventory/origen_inventory/client.lua @@ -19,6 +19,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return origin:Items() +end + ---Will return boolean if the player has the item. ---@param item string ---@return boolean diff --git a/modules/inventory/origen_inventory/server.lua b/modules/inventory/origen_inventory/server.lua index 756fa60..b6d799c 100644 --- a/modules/inventory/origen_inventory/server.lua +++ b/modules/inventory/origen_inventory/server.lua @@ -92,6 +92,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return origin:Items() +end + ---This will return the count of the item in the players inventory, if not found will return 0. ---if metadata is passed it will find the matching items count. ---@param src number diff --git a/modules/inventory/ox_inventory/client.lua b/modules/inventory/ox_inventory/client.lua index 5539a97..9a676e8 100644 --- a/modules/inventory/ox_inventory/client.lua +++ b/modules/inventory/ox_inventory/client.lua @@ -23,6 +23,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return ox_inventory:Items() +end + ---Will return boolean if the player has the item. ---@param item string ---@return boolean diff --git a/modules/inventory/ox_inventory/server.lua b/modules/inventory/ox_inventory/server.lua index 35578e0..2a35e95 100644 --- a/modules/inventory/ox_inventory/server.lua +++ b/modules/inventory/ox_inventory/server.lua @@ -74,6 +74,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return ox_inventory:Items() +end + ---This will return the count of the item in the players inventory, if not found will return 0. --- ---if metadata is passed it will find the matching items count. diff --git a/modules/inventory/ps-inventory/client.lua b/modules/inventory/ps-inventory/client.lua index fa55848..86b4e55 100644 --- a/modules/inventory/ps-inventory/client.lua +++ b/modules/inventory/ps-inventory/client.lua @@ -20,6 +20,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---Will return boolean if the player has the item. ---@param item string ---@return boolean diff --git a/modules/inventory/ps-inventory/server.lua b/modules/inventory/ps-inventory/server.lua index d6ba99e..0b53263 100644 --- a/modules/inventory/ps-inventory/server.lua +++ b/modules/inventory/ps-inventory/server.lua @@ -66,6 +66,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---Returns the specified slot data as a table. --- ---format {weight, name, metadata, slot, label, count} diff --git a/modules/inventory/qb-inventory/client.lua b/modules/inventory/qb-inventory/client.lua index 6870be1..b71db1a 100644 --- a/modules/inventory/qb-inventory/client.lua +++ b/modules/inventory/qb-inventory/client.lua @@ -20,6 +20,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---Will return boolean if the player has the item. ---@param item string ---@return boolean diff --git a/modules/inventory/qb-inventory/server.lua b/modules/inventory/qb-inventory/server.lua index cdefa7b..ae8b715 100644 --- a/modules/inventory/qb-inventory/server.lua +++ b/modules/inventory/qb-inventory/server.lua @@ -107,6 +107,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return Framework.Shared.Items +end + ---Returns the specified slot data as a table. ---format {weight, name, metadata, slot, label, count} ---@param src number diff --git a/modules/inventory/qs-inventory/client.lua b/modules/inventory/qs-inventory/client.lua index d309ddd..b63fc9a 100644 --- a/modules/inventory/qs-inventory/client.lua +++ b/modules/inventory/qs-inventory/client.lua @@ -22,6 +22,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return quasar:GetItemList() +end + ---Will return boolean if the player has the item. ---@param item string ---@return boolean diff --git a/modules/inventory/qs-inventory/server.lua b/modules/inventory/qs-inventory/server.lua index 70c480b..8ae16a4 100644 --- a/modules/inventory/qs-inventory/server.lua +++ b/modules/inventory/qs-inventory/server.lua @@ -84,6 +84,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return quasar:GetItemList() +end + ---This will return the count of the item in the players inventory, if not found will return 0. --- ---if metadata is passed it will find the matching items count. diff --git a/modules/inventory/tgiann-inventory/server.lua b/modules/inventory/tgiann-inventory/server.lua index 5c48b49..1e38751 100644 --- a/modules/inventory/tgiann-inventory/server.lua +++ b/modules/inventory/tgiann-inventory/server.lua @@ -46,6 +46,12 @@ Inventory.GetItemInfo = function(item) } end +---This will return the entire items table from the inventory. +---@return table +Inventory.Items = function() + return tgiann:GetItemList() +end + ---This will return the count of the item in the players inventory, if not found will return 0. --- ---if metadata is passed it will find the matching items count.