diff --git a/data/campaigns/Dead_Water/scenarios/02_Flight.cfg b/data/campaigns/Dead_Water/scenarios/02_Flight.cfg
index aabe4905dac..0ab5daf2fdc 100644
--- a/data/campaigns/Dead_Water/scenarios/02_Flight.cfg
+++ b/data/campaigns/Dead_Water/scenarios/02_Flight.cfg
@@ -84,8 +84,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat all enemy leaders (different bonus for each)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat all enemy leaders"+{OBJECTIVE_FOOTNOTE "(different bonus for each)"}
condition=win
[/objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/02_Blackwater_Port.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/02_Blackwater_Port.cfg
index 95ff66fe390..444621eca91 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/02_Blackwater_Port.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/02_Blackwater_Port.cfg
@@ -20,8 +20,8 @@
[/objective]
#ifdef HARD
[objective]
- description= _ "Alternative objective:
-Defeat the enemy leader (special bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat the enemy leader"+{OBJECTIVE_FOOTNOTE "(special bonus)"}
condition=win
[/objective]
#endif
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/04_The_Bay_of_Pearls.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/04_The_Bay_of_Pearls.cfg
index 91043e12706..29b2aa437ed 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/04_The_Bay_of_Pearls.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/04_The_Bay_of_Pearls.cfg
@@ -20,8 +20,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat all enemy leaders (early finish bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat all enemy leaders"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
index 6be35d79725..70280b1c4f8 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/05a_Muff_Malal_Peninsula.cfg
@@ -22,8 +22,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat Muff Malal (early finish bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat Muff Malal"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/05b_Isle_of_the_Damned.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/05b_Isle_of_the_Damned.cfg
index 333c2dffe16..12e542874f4 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/05b_Isle_of_the_Damned.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/05b_Isle_of_the_Damned.cfg
@@ -20,8 +20,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat all enemy leaders (special bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat all enemy leaders"+{OBJECTIVE_FOOTNOTE "(special bonus)"}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg
index 168d164aa33..c9c873e35c7 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/09_The_Valley_of_Death.cfg
@@ -19,8 +19,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Eradicate the liches (early finish bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Eradicate the liches"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/19b_Swamp_Of_Dread.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/19b_Swamp_Of_Dread.cfg
index e373e4e0381..f91eee11e14 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/19b_Swamp_Of_Dread.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/19b_Swamp_Of_Dread.cfg
@@ -22,8 +22,8 @@
condition=win
[/objective]
[objective]
- description= _ "Bonus objective:
-Defeat all Death Knights first"
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat all Death Knights first"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg
index 5a976451194..e91d7dd2e27 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/19c_Cliffs_of_Thoria.cfg
@@ -827,8 +827,8 @@ Soooo... It is you who sent your subordinates to attack us. Now when we've destr
condition=win
[/objective]
[objective]
- description= _ "Optional objective:
-Rescue the sergeant"
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Rescue the sergeant"
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/20b_Underground_Channels.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/20b_Underground_Channels.cfg
index 1340ae61be6..0963ff6cb30 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/20b_Underground_Channels.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/20b_Underground_Channels.cfg
@@ -24,8 +24,13 @@
condition=win
[/objective]
[objective]
- description= _ "Optional objective:
-Help the Wose fend off the undead attack"
+ # There's no actual bonus to be gained yet...
+ [show_if]
+ [not]
+ [/not]
+ [/show_if]
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Help the Wose fend off the undead attack"
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/23_Test_of_the_Clans.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/23_Test_of_the_Clans.cfg
index f0755746276..76918e64f71 100644
--- a/data/campaigns/Heir_To_The_Throne/scenarios/23_Test_of_the_Clans.cfg
+++ b/data/campaigns/Heir_To_The_Throne/scenarios/23_Test_of_the_Clans.cfg
@@ -40,8 +40,8 @@
condition=win
[/objective]
[objective]
- description= _ "Bonus objective:
-Defeat all enemy leaders"
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat all enemy leaders"
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/02_Hostile_mountains.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/02_Hostile_mountains.cfg
index e86a4dddb16..0fc4e387350 100644
--- a/data/campaigns/Legend_of_Wesmere/scenarios/02_Hostile_mountains.cfg
+++ b/data/campaigns/Legend_of_Wesmere/scenarios/02_Hostile_mountains.cfg
@@ -508,8 +508,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat Grugl"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat Grugl"
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Legend_of_Wesmere/scenarios/03_Kalian.cfg b/data/campaigns/Legend_of_Wesmere/scenarios/03_Kalian.cfg
index 38da2ff7264..e4dd2fa3028 100644
--- a/data/campaigns/Legend_of_Wesmere/scenarios/03_Kalian.cfg
+++ b/data/campaigns/Legend_of_Wesmere/scenarios/03_Kalian.cfg
@@ -846,7 +846,8 @@
condition=win
[/objective]
[objective]
- description= _ "Bonus objective: Defeat Urudin "
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat Urudin"
condition=win
[/objective]
[/objectives]
diff --git a/data/campaigns/Sceptre_of_Fire/scenarios/1_A_Bargain_is_Struck.cfg b/data/campaigns/Sceptre_of_Fire/scenarios/1_A_Bargain_is_Struck.cfg
index 466a14863f5..4f89df5f757 100644
--- a/data/campaigns/Sceptre_of_Fire/scenarios/1_A_Bargain_is_Struck.cfg
+++ b/data/campaigns/Sceptre_of_Fire/scenarios/1_A_Bargain_is_Struck.cfg
@@ -127,8 +127,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat Glildur (early finish bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat Glildur"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/Son_Of_The_Black_Eye/scenarios/03_Towards_Mountains_of_Haag.cfg b/data/campaigns/Son_Of_The_Black_Eye/scenarios/03_Towards_Mountains_of_Haag.cfg
index f7881eab05a..1c5b12ce4d0 100644
--- a/data/campaigns/Son_Of_The_Black_Eye/scenarios/03_Towards_Mountains_of_Haag.cfg
+++ b/data/campaigns/Son_Of_The_Black_Eye/scenarios/03_Towards_Mountains_of_Haag.cfg
@@ -31,8 +31,8 @@
[/objective]
[objective]
condition=win
- description=_ "Bonus objective:
-Defeat the enemy leader (early finish bonus)"
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat the enemy leader"+{EARLY_FINISH_BONUS_FOOTNOTE}
[/objective]
[objective]
condition=lose
@@ -277,8 +277,8 @@
[/objective]
[objective]
condition=win
- description=_ "Bonus objective:
-Defeat the enemy leader (early finish bonus)"
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat the enemy leader"+{EARLY_FINISH_BONUS_FOOTNOTE}
[/objective]
[objective]
condition=lose
diff --git a/data/campaigns/Son_Of_The_Black_Eye/scenarios/09_Shan_Taum_The_Smug.cfg b/data/campaigns/Son_Of_The_Black_Eye/scenarios/09_Shan_Taum_The_Smug.cfg
index 025047db4bb..857bf68a276 100644
--- a/data/campaigns/Son_Of_The_Black_Eye/scenarios/09_Shan_Taum_The_Smug.cfg
+++ b/data/campaigns/Son_Of_The_Black_Eye/scenarios/09_Shan_Taum_The_Smug.cfg
@@ -21,8 +21,8 @@
condition=win
[/objective]
[objective]
- description= _ "Alternative objective:
-Defeat Shan Taum (early finish bonus)"
+ {ALTERNATIVE_OBJECTIVE_CAPTION}
+ description= _ "Defeat Shan Taum"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/08_Clearwater_Port.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/08_Clearwater_Port.cfg
index b46a6570b18..4dbea302c98 100644
--- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/08_Clearwater_Port.cfg
+++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/08_Clearwater_Port.cfg
@@ -227,21 +227,23 @@
[objectives]
side=1
[objective]
- description= _ "Cowardly: Flee on the First Ship"
+ caption= _ "Cowardly:"
+ description= _ "Flee on the First Ship"
condition=win
[/objective]
[objective]
- description= _ "Normal: Flee on the Second Ship"
+ caption= _ "Normal:"
+ description= _ "Flee on the Second Ship"
condition=win
[/objective]
[objective]
- description= _ "Heroic: Flee on the Third Ship"+"
-"+{EARLY_FINISH_BONUS_CAPTION}
+ caption= _ "Heroic:"
+ description= _ "Flee on the Third Ship"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
- description= _ "Heroic: Defeat all enemy leaders"+"
-"+{EARLY_FINISH_BONUS_CAPTION}
+ caption= _ "Heroic:"
+ description= _ "Defeat all enemy leaders"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/09_Fallen_Lich_Point.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/09_Fallen_Lich_Point.cfg
index c643d7d8005..b3ac6bce19b 100644
--- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/09_Fallen_Lich_Point.cfg
+++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/09_Fallen_Lich_Point.cfg
@@ -189,8 +189,8 @@
[/objective]
# FIXME: looks like only one orc leader needs to be killed
[objective]
- description= _ "Heroic: In addition to above, kill all enemy leaders"+"
-"+{EARLY_FINISH_BONUS_CAPTION}
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat all enemy leaders"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/10_Sewer.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/10_Sewer.cfg
index 351c679b010..3ac77c97824 100644
--- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/10_Sewer.cfg
+++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/10_Sewer.cfg
@@ -126,8 +126,8 @@
condition=win
[/objective]
[objective]
- description= _ "Defeat all enemy leaders and Prince Haldric exits the sewer"+"
-"+{EARLY_FINISH_BONUS_CAPTION}
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Defeat all enemy leaders and Prince Haldric exits the sewer"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/17a_The_Dragon.cfg b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/17a_The_Dragon.cfg
index a96ad464077..c2c037f84f1 100644
--- a/data/campaigns/The_Rise_Of_Wesnoth/scenarios/17a_The_Dragon.cfg
+++ b/data/campaigns/The_Rise_Of_Wesnoth/scenarios/17a_The_Dragon.cfg
@@ -212,8 +212,8 @@
condition=win
[/objective]
[objective]
- description= _ "Heroic: Slay the Dragon and defeat all enemies"+"
-"+{EARLY_FINISH_BONUS_CAPTION}
+ {BONUS_OBJECTIVE_CAPTION}
+ description= _ "Slay the Dragon and defeat all enemy leaders"+{EARLY_FINISH_BONUS_FOOTNOTE}
condition=win
[/objective]
[objective]
diff --git a/data/core/macros/carryover-utils.cfg b/data/core/macros/carryover-utils.cfg
index 78d464ee8d2..7a11b9bf06e 100644
--- a/data/core/macros/carryover-utils.cfg
+++ b/data/core/macros/carryover-utils.cfg
@@ -14,6 +14,9 @@ _"No early finish bonus."#enddef
#define EARLY_FINISH_BONUS_CAPTION
_"(early finish bonus)"#enddef
+#define EARLY_FINISH_BONUS_FOOTNOTE
+" " + _"(early finish bonus)" + ""#enddef
+
#define NO_GOLD_CARRYOVER_NOTE
_"No gold carried over to the next scenario."#enddef
diff --git a/data/core/macros/scenario-utils.cfg b/data/core/macros/scenario-utils.cfg
index 201ac2136b0..0908c1bde07 100644
--- a/data/core/macros/scenario-utils.cfg
+++ b/data/core/macros/scenario-utils.cfg
@@ -34,6 +34,18 @@ x,y=1-999,1-999 #enddef
[/objectives]
#enddef
+#define OBJECTIVE_FOOTNOTE TEXT
+" " + {TEXT} + ""
+#enddef
+
+#define ALTERNATIVE_OBJECTIVE_CAPTION
+caption= _ "Alternative objective:"
+#enddef
+
+#define BONUS_OBJECTIVE_CAPTION
+caption= _ "Bonus objective:"
+#enddef
+
#define VICTORY_CONDITION DESCRIPTION
# Used in conjunction with SET_OBJECTIVES this sets a victory condition
# (marked green).
diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua
index eff57099246..b5ed5853292 100644
--- a/data/lua/wml-tags.lua
+++ b/data/lua/wml-tags.lua
@@ -34,16 +34,28 @@ local function generate_objectives(cfg)
local gold_carryover_string = cfg.gold_carryover_string or _ "Gold carryover:"
local notes_string = cfg.notes_string or _ "Notes:"
+ local bullet = "• "
+
for obj in helper.child_range(cfg, "objective") do
local show_if = helper.get_child(obj, "show_if")
if not show_if or wesnoth.eval_conditional(show_if) then
local condition = obj.condition
if condition == "win" then
- win_objectives = win_objectives .. color_prefix(0, 255, 0) ..
- insert_before_nl(obj.description, "") .. "\n"
+ local caption = obj.caption
+
+ if caption ~= nil then
+ win_objectives = win_objectives .. caption .. "\n"
+ end
+
+ win_objectives = win_objectives .. color_prefix(0, 255, 0) .. bullet .. obj.description .. "" .. "\n"
elseif condition == "lose" then
- lose_objectives = lose_objectives .. color_prefix(255, 0 ,0) ..
- insert_before_nl(obj.description, "") .. "\n"
+ local caption = obj.caption
+
+ if caption ~= nil then
+ lose_objectives = lose_objectives .. caption .. "\n"
+ end
+
+ lose_objectives = lose_objectives .. color_prefix(255, 0, 0) .. bullet .. obj.description .. "" .. "\n"
else
wesnoth.message "Unknown condition, ignoring."
end
@@ -53,20 +65,20 @@ local function generate_objectives(cfg)
for obj in helper.child_range(cfg, "gold_carryover") do
if obj.bonus ~= nil then
if obj.bonus then
- gold_carryover = color_prefix(255, 255, 192) .. "" .. _"Early finish bonus." .. "\n"
+ gold_carryover = color_prefix(255, 255, 192) .. bullet .. "" .. _"Early finish bonus." .. "\n"
else
- gold_carryover = color_prefix(255, 255, 192) .. "" .. _"No early finish bonus." .. "\n"
+ gold_carryover = color_prefix(255, 255, 192) .. bullet .. "" .. _"No early finish bonus." .. "\n"
end
end
if obj.carryover_percentage then
- gold_carryover = gold_carryover .. color_prefix(255, 255, 192) .. "" .. string.format(tostring(_ "%d%% of gold carried over to the next scenario."), obj.carryover_percentage) .. "\n"
+ gold_carryover = gold_carryover .. color_prefix(255, 255, 192) .. bullet .. "" .. string.format(tostring(_ "%d%% of gold carried over to the next scenario."), obj.carryover_percentage) .. "\n"
end
end
for note in helper.child_range(cfg, "note") do
if note.description ~= nil then
- notes = notes .. color_prefix(255, 255, 255) .. "" .. note.description .. "\n"
+ notes = notes .. color_prefix(255, 255, 255) .. bullet .. "" .. note.description .. "\n"
end
end