forked from Simnation/Main
Update main.lua
This commit is contained in:
parent
9eb99a91fa
commit
979424888b
1 changed files with 20 additions and 11 deletions
|
@ -86,9 +86,17 @@ local function buildMarkedBillsMenu()
|
||||||
local playerInventory = lib.callback.await('r_moneywash:getPlayerInventory', false)
|
local playerInventory = lib.callback.await('r_moneywash:getPlayerInventory', false)
|
||||||
for _, item in pairs(playerInventory) do
|
for _, item in pairs(playerInventory) do
|
||||||
if item.name == Cfg.Options.Currency then
|
if item.name == Cfg.Options.Currency then
|
||||||
|
-- Add a check for metadata
|
||||||
|
local description = ""
|
||||||
|
if item.metadata and item.metadata.worth then
|
||||||
|
description = _L('marked_worth', item.metadata.worth)
|
||||||
|
else
|
||||||
|
description = _L('marked_worth', item.count) -- Fallback to using the count or another appropriate value
|
||||||
|
end
|
||||||
|
|
||||||
table.insert(options, {
|
table.insert(options, {
|
||||||
title = item.label,
|
title = item.label,
|
||||||
description = _L('marked_worth', item.metadata.worth),
|
description = description,
|
||||||
icon = 'fas fa-money-bill-wave',
|
icon = 'fas fa-money-bill-wave',
|
||||||
iconColor = '#fa5252',
|
iconColor = '#fa5252',
|
||||||
onSelect = function()
|
onSelect = function()
|
||||||
|
@ -97,6 +105,7 @@ local function buildMarkedBillsMenu()
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
lib.registerContext({
|
lib.registerContext({
|
||||||
id = 'moneywash_markedbills',
|
id = 'moneywash_markedbills',
|
||||||
title = _L('money_wash'),
|
title = _L('money_wash'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue