From 8f821c817af84ce09d5120d03a31bf6f15dbaddd Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 10 Apr 2019 15:14:16 +0300 Subject: [PATCH] (ec5f3cd24) Added mission texts to EnglishVanilla, use "[reward]" tag in the texts instead of the actual number so we don't have to change the descriptions if we change the reward --- .../BarotraumaShared/Source/Events/Missions/Mission.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Barotrauma/BarotraumaShared/Source/Events/Missions/Mission.cs b/Barotrauma/BarotraumaShared/Source/Events/Missions/Mission.cs index e8f5e87fd..c317d6e7a 100644 --- a/Barotrauma/BarotraumaShared/Source/Events/Missions/Mission.cs +++ b/Barotrauma/BarotraumaShared/Source/Events/Missions/Mission.cs @@ -91,6 +91,13 @@ namespace Barotrauma Messages[m] = Messages[m].Replace("[location" + (n + 1) + "]", locations[n].Name); } } + if (description != null) description = description.Replace("[reward]", Reward.ToString("N0")); + if (successMessage != null) successMessage = successMessage.Replace("[reward]", Reward.ToString("N0")); + if (failureMessage != null) failureMessage = failureMessage.Replace("[reward]", Reward.ToString("N0")); + for (int m = 0; m < Messages.Count; m++) + { + Messages[m] = Messages[m].Replace("[reward]", Reward.ToString("N0")); + } } public static Mission LoadRandom(Location[] locations, string seed, bool requireCorrectLocationType, MissionType missionType, bool isSinglePlayer = false) {