SoF: Fix runecrafting gold cost being non-translatable

Addresses #5889
This commit is contained in:
Celtic Minstrel 2021-06-26 11:40:02 -04:00
parent cd9781e593
commit 08f9aade4b
3 changed files with 17 additions and 3 deletions

View file

@ -110,6 +110,9 @@ Their tale I now relate...</i>
name = "doofus-01"
[/entry]
[/about]
[lua]
code=<<wesnoth.dofile "campaigns/Sceptre_of_Fire/lua/rune-equip.lua">>
[/lua]
[/campaign]
#ifdef CAMPAIGN_SCEPTRE_FIRE

View file

@ -0,0 +1,10 @@
function wesnoth.wml_actions.rune_choice(cfg)
cfg = wml.literal(cfg)
for i, tag in ipairs(cfg) do
if tag[1] == "option" then
tag[2].label = tag[2].label:vformat{cost = tag[2].cost}
end
end
wesnoth.wml_actions.message(wml.tovconfig(cfg))
end

View file

@ -2,7 +2,8 @@
#define SOF_RUNIC_OPTION ID NAME DESC ICON COST EFFECT_WML
image={ICON}
label= {NAME} + " <span style='italic'> ({COST}g)</span>"
cost={COST}
label= {NAME} + " <span style='italic'> (" + _"$cost|g" + ")</span>"
description = {DESC}
[command]
[if]
@ -280,7 +281,7 @@
[filter]
find_in=rune_customer
[/filter]
[message]
[rune_choice]
speaker=Thursagan
message= _ "I can hammer out a quick little runic charm, it should help you somewhat. This isn't the place to do really good work though, so the effects will vanish in the future. What do you say, is it worth a bit of gold and crystal?"
[option]
@ -337,7 +338,7 @@
[/effect]
)}
[/option]
[/message]
[/rune_choice]
[/event]
[/event]