Remove example scripts and update core logic
Deleted all files in the examples directory to clean up unused or test scripts. Updated fxmanifest.lua to enable ox_lib initialization. Improved error handling and entity tracking in utility functions, added prop removal, and made minor localization and code style adjustments throughout the codebase. Significant reword of inventory module, notification module, and framework module. Added support for wasabi_uikit, added support for keep-progressbars,
This commit is contained in:
1 parent
c40a260ea2
commit
343af95794
100 files changed
+2403
-2755
No files matched your search
@@ -1,40 +1,40 @@
|
||||
---@diagnostic disable: duplicate-set-field
|
||||
if GetResourceState('qs-inventory') ~= 'started' then return end
|
||||
if GetResourceState('qs-inventory') == 'missing' then return end
|
||||
local quasar = exports["qs-inventory"]
|
||||
|
||||
Inventory = Inventory or {}
|
||||
|
||||
---Return the item info in oxs format, {name, label, stack, weight, description, image}
|
||||
---@param item string
|
||||
---@return table
|
||||
Inventory.GetItemInfo = function(item)
|
||||
local itemsData = quasar:GetItemList()
|
||||
if not itemsData then return {} end
|
||||
local itemData = itemsData[item]
|
||||
if not itemData then return {} end
|
||||
return {
|
||||
name = itemData.name or "Missing Name",
|
||||
label = itemData.label or "Missing Label",
|
||||
stack = itemData.unique or "false",
|
||||
weight = itemData.weight or "0",
|
||||
description = itemData.description or "none",
|
||||
image = Inventory.GetImagePath(item),
|
||||
}
|
||||
end
|
||||
|
||||
---This will get the name of the in use resource.
|
||||
---@description This will get the name of the in use resource.
|
||||
---@return string
|
||||
Inventory.GetResourceName = function()
|
||||
return "qs-inventory"
|
||||
end
|
||||
|
||||
---This will return the entire items table from the inventory.
|
||||
---@description Return the item info in oxs format, {name, label, stack, weight, description, image}
|
||||
---@param item string
|
||||
---@return table
|
||||
Inventory.GetItemInfo = function(item)
|
||||
local itemsData = quasar:GetItemList()
|
||||
if not itemsData then return {} end
|
||||
itemsData = itemsData[item]
|
||||
if not itemsData then return {} end
|
||||
return {
|
||||
name = itemsData.name or "Missing Name",
|
||||
label = itemsData.label or "Missing Label",
|
||||
stack = itemsData.unique or "false",
|
||||
weight = itemsData.weight or "0",
|
||||
description = itemsData.description or "none",
|
||||
image = Inventory.GetImagePath(item),
|
||||
}
|
||||
end
|
||||
|
||||
---@description 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.
|
||||
---@description Will return boolean if the player has the item.
|
||||
---@param item string
|
||||
---@return boolean
|
||||
Inventory.HasItem = function(item)
|
||||
@@ -42,7 +42,7 @@ Inventory.HasItem = function(item)
|
||||
return check and true or false
|
||||
end
|
||||
|
||||
---This will return th count of the item in the players inventory, if not found will return 0.
|
||||
---@description This will return th count of the item in the players inventory, if not found will return 0.
|
||||
---@param item string
|
||||
---@return number
|
||||
Inventory.GetItemCount = function(item)
|
||||
@@ -50,7 +50,7 @@ Inventory.GetItemCount = function(item)
|
||||
return searchItem or 0
|
||||
end
|
||||
|
||||
---This will get the image path for this item, if not found will return placeholder.
|
||||
---@description This will get the image path for this item, if not found will return placeholder.
|
||||
---@param item string
|
||||
---@return string
|
||||
Inventory.GetImagePath = function(item)
|
||||
@@ -60,7 +60,7 @@ Inventory.GetImagePath = function(item)
|
||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||
end
|
||||
|
||||
---This will return the players inventory in the format of {name, label, count, slot, metadata}
|
||||
---@description This will return the players inventory in the format of {name, label, count, slot, metadata}
|
||||
---@return table
|
||||
Inventory.GetPlayerInventory = function()
|
||||
local items = {}
|
||||
@@ -69,10 +69,10 @@ Inventory.GetPlayerInventory = function()
|
||||
table.insert(items, {
|
||||
name = v.name,
|
||||
label = v.label,
|
||||
count = v.amount,
|
||||
count = v.amount or v.count,
|
||||
slot = v.slot,
|
||||
metadata = v.info,
|
||||
stack = v.unique,
|
||||
metadata = v.info or v.metadata or {},
|
||||
stack = v.unique or v.stack or false,
|
||||
close = v.useable,
|
||||
weight = v.weight
|
||||
})
|
||||
@@ -80,11 +80,4 @@ Inventory.GetPlayerInventory = function()
|
||||
return items
|
||||
end
|
||||
|
||||
---comment
|
||||
---@param id any
|
||||
---@return nil
|
||||
Inventory.OpenStash = function(id)
|
||||
quasar:RegisterStash(id, 50, 50000)
|
||||
end
|
||||
|
||||
return Inventory
|
||||
Reference in new issue
Block a user