image pathing fixed on tgiann
this -- "nui://inventory_images/html/images/%s.png" Is not the path, it its instead nui://inventory_images/images/%s.png" Also strip webp function added. And indexing itemdata was required.
This commit is contained in:
1 parent
fa9ea6e6eb
commit
5abebe13c6
4 files changed
+30
-10
No files matched your search
@@ -36,6 +36,10 @@ Inventory.GetImagePath = function(item)
|
||||
return "https://avatars.githubusercontent.com/u/47620135"
|
||||
end
|
||||
|
||||
---This will remove the file extension from the item name if present.
|
||||
---example: "item.png" will become "item"
|
||||
---@param item string
|
||||
---@return string
|
||||
Inventory.StripPNG = function(item)
|
||||
if string.find(item, ".png") then
|
||||
item = string.gsub(item, ".png", "")
|
||||
@@ -43,6 +47,10 @@ Inventory.StripPNG = function(item)
|
||||
return item
|
||||
end
|
||||
|
||||
---This will remove the file extension from the item name if present.
|
||||
---example: "item.webp" will become "item"
|
||||
---@param item string
|
||||
---@return string
|
||||
Inventory.StripWebp = function(item)
|
||||
if string.find(item, ".webp") then
|
||||
item = string.gsub(item, ".webp", "")
|
||||
|
||||
Reference in new issue
Block a user