From 87eb44312182a1d619d04ef1ab7863ead14e8b3a Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Fri, 8 Apr 2016 22:20:05 +0200 Subject: [PATCH] Add upgrade rule for moving InsufficientFundsWarning logic to PlayerResources --- OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index eb4b56edfb..95d193bf23 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -757,6 +757,19 @@ namespace OpenRA.Mods.Common.UtilityCommands node.Key = "EffectImage"; } + if (engineVersion < 20160408) + { + var traitNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "InsufficientFundsWarning"); + if (traitNode != null) + { + var prNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "PlayerResources"); + if (prNode != null) + prNode.Value.Nodes.Add(new MiniYamlNode("InsufficientFundsNotification", new MiniYaml("InsufficientFunds"))); + + node.Value.Nodes.Remove(traitNode); + } + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } }