inv diagnostics + repacked tables

This commit is contained in:
MrNewb committed 2025-05-09 02:00:02 -04:00
1 parent c0662e1069
commit 485c2d3460
20 files changed
+69 -36

No files matched your search

+2 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('jpr-inventory') ~= 'started' then return end
local jpr = exports['jpr-inventory']
@@ -29,7 +30,7 @@ end
Inventory.GetItemInfo = function(item)
local itemData = Framework.Shared.Items[item]
if not itemData then return {} end
local repackedTable = {
return {
name = itemData.name,
label = itemData.label,
stack = itemData.unique,
@@ -37,5 +38,4 @@ Inventory.GetItemInfo = function(item)
description = itemData.description,
image = Inventory.GetImagePath(itemData.name)
}
return repackedTable
end
+11 -1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('jpr-inventory') ~= 'started' then return end
local jpr = exports['jpr-inventory']
@@ -56,7 +57,16 @@ end
Inventory.GetItemBySlot = function(src, slot)
local slotData = jpr:GetItemBySlot(src, slot)
if not slotData then return {} end
return { name = slotData.name, label = slotData.label, weight = slotData.weight, slot = slot, count = slotData.amount, metadata = slotData.info, stack = slotData.unique, description = slotData.description }
return {
name = slotData.name,
label = slotData.label,
weight = slotData.weight,
slot = slot,
count = slotData.amount,
metadata = slotData.info,
stack = slotData.unique,
description = slotData.description
}
end
---comment