EI S04b: Avoid using a macro in a translatable string
The required number is already in a WML variable, herbs_needed. However, the string is used in an `[objective]` tag, which means we're not necessarily in an ActionWML block when it's shown, and thus can't use the Lua API to look up plural strings. Instead, brute force it by making 6 separate strings. Also, use the mainline `ALTERNATIVE_OBJECTIVE_CAPTION` macro instead of a campaign-specific translatable string.
This commit is contained in:
parent
29d21434c1
commit
30b91ad902
3 changed files with 13 additions and 20 deletions
3
changelog_entries/ei_macro_in_string.md
Normal file
3
changelog_entries/ei_macro_in_string.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
### Campaigns
|
||||
* Eastern Invasion
|
||||
* Fix macro argument in translatable string
|
|
@ -159,10 +159,7 @@
|
|||
condition=win
|
||||
[/objective]
|
||||
[objective]
|
||||
description= _ "-OR-"
|
||||
condition=win
|
||||
[/objective]
|
||||
[objective]
|
||||
{ALTERNATIVE_OBJECTIVE_CAPTION}
|
||||
description= _ "To travel east, defeat Mal-Kallat. <i>(normal)</i>"
|
||||
condition=win
|
||||
[/objective]
|
||||
|
|
|
@ -508,9 +508,10 @@
|
|||
[redraw]
|
||||
[/redraw]
|
||||
|
||||
#define HERBS_OBJECTIVE COUNT
|
||||
#define HERBS_OBJECTIVE COUNT STRING
|
||||
[objective]
|
||||
description= _ "To travel east, collect {COUNT} alswdan herbs and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>"
|
||||
{ALTERNATIVE_OBJECTIVE_CAPTION}
|
||||
description={STRING}
|
||||
condition=win
|
||||
[show_if]
|
||||
[have_unit]
|
||||
|
@ -541,20 +542,12 @@
|
|||
description= _ "To travel west, defeat Mal-Skraat. <i>(normal)</i>"
|
||||
condition=win
|
||||
[/objective]
|
||||
[objective]
|
||||
description= _ "-OR-"
|
||||
condition=win
|
||||
{SHOW_IF_HERBS_OBJECTIVE_ACTIVE}
|
||||
[/objective]
|
||||
{HERBS_OBJECTIVE 9} # 7+ not used right now, but just in case
|
||||
{HERBS_OBJECTIVE 8}
|
||||
{HERBS_OBJECTIVE 7}
|
||||
{HERBS_OBJECTIVE 6}
|
||||
{HERBS_OBJECTIVE 5}
|
||||
{HERBS_OBJECTIVE 4}
|
||||
{HERBS_OBJECTIVE 3}
|
||||
{HERBS_OBJECTIVE 2}
|
||||
{HERBS_OBJECTIVE 1}
|
||||
{HERBS_OBJECTIVE 6 (_ "To travel east, collect 6 alswdan herbs and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>")}
|
||||
{HERBS_OBJECTIVE 5 (_ "To travel east, collect 5 alswdan herbs and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>")}
|
||||
{HERBS_OBJECTIVE 4 (_ "To travel east, collect 4 alswdan herbs and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>")}
|
||||
{HERBS_OBJECTIVE 3 (_ "To travel east, collect 3 alswdan herbs and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>")}
|
||||
{HERBS_OBJECTIVE 2 (_ "To travel east, collect 2 alswdan herbs and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>")}
|
||||
{HERBS_OBJECTIVE 1 (_ "To travel east, collect 1 alswdan herb and pay Hahid al-Ali $gold_cost gold. <i>(challenging)</i>")}
|
||||
[objective]
|
||||
description= _ "Death of Gweddry or Dacyn"
|
||||
condition=lose
|
||||
|
|
Loading…
Add table
Reference in a new issue