image path tweaks
This commit is contained in:
1 parent
2d02e8b0df
commit
fa9ea6e6eb
2 files changed
+13
-4
No files matched your search
@@ -39,10 +39,11 @@ end
|
||||
---@param item string
|
||||
---@return string
|
||||
Inventory.GetImagePath = function(item)
|
||||
item = Inventory.StripPNG(item)
|
||||
local pngPath = LoadResourceFile("inventory_images", string.format("html/images/%s.png", item))
|
||||
local webpPath = LoadResourceFile("inventory_images", string.format("html/images/%s.webp", item))
|
||||
local imagePath = pngPath and string.format("nui://inventory_images/html/images/%s.png", item) or webpPath and string.format("nui://inventory_images/html/images/%s.webp", item)
|
||||
local pngItem = Inventory.StripPNG(item)
|
||||
local webpItem = Inventory.StripWebp(item)
|
||||
local pngPath = LoadResourceFile("inventory_images", string.format("html/images/%s.png", pngItem))
|
||||
local webpPath = LoadResourceFile("inventory_images", string.format("html/images/%s.webp", webpItem))
|
||||
local imagePath = pngPath and string.format("nui://inventory_images/html/images/%s.png", pngItem) or webpPath and string.format("nui://inventory_images/html/images/%s.webp", webpItem)
|
||||
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user