Skip to content

Commit

Permalink
use string.format
Browse files Browse the repository at this point in the history
  • Loading branch information
bmos committed May 27, 2023
1 parent 287aed9 commit 4294d11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/coinweight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ local function computeCoins(nodeChar)
DB.setValue(nodeCoinsItem, 'name', 'string', COINS_INVENTORY_ITEM_NAME)
DB.setValue(nodeCoinsItem, 'count', 'number', 1)
DB.setValue(nodeCoinsItem, 'type', 'string', 'Wealth and Money')
DB.setValue(nodeCoinsItem, 'description', 'formattedtext', '<p>' .. Interface.getString('item_description_coins') .. '</p>')
DB.setValue(nodeCoinsItem, 'description', 'formattedtext', string.format('<p>%s</p>', Interface.getString('item_description_coins')))
return nodeCoinsItem
end
end
Expand Down Expand Up @@ -158,8 +158,8 @@ function onInit()
CharEncumbranceManager.calcDefaultCurrencyEncumbrance = calcDefaultCurrencyEncumbrance_new
if not Session.IsHost then return end
for _, sCurrencyPath in pairs(CurrencyManager.getCurrencyPaths('charsheet')) do
DB.addHandler('charsheet.*.' .. sCurrencyPath .. '.*', 'onChildUpdate', onCoinsValueChanged)
DB.addHandler('charsheet.*.' .. sCurrencyPath, 'onChildDeleted', onCoinsDeleted)
DB.addHandler(string.format('charsheet.*.%s.*', sCurrencyPath), 'onChildUpdate', onCoinsValueChanged)
DB.addHandler(string.format('charsheet.*.%s', sCurrencyPath), 'onChildDeleted', onCoinsDeleted)
end
DB.addHandler(CurrencyManager.CAMPAIGN_CURRENCY_LIST .. '.*.', 'onChildUpdate', onDenominationsChanged)
DB.addHandler(CurrencyManager.CAMPAIGN_CURRENCY_LIST, 'onChildDeleted', onDenominationsChanged)
Expand Down

0 comments on commit 4294d11

Please sign in to comment.