From 95d8d1d45d9b25aa2a55a41b5d493b940aa65d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 2 Apr 2014 21:21:30 +0200 Subject: [PATCH 1/2] show disabled overlay when TD defenses power down closes #5005 --- mods/cnc/rules/structures.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index e32218487b..8641a294a9 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -543,7 +543,6 @@ GUN: SAM: Inherits: ^Building - RequiresPower: Valued: Cost: 750 CustomBuildTimeValue: @@ -560,6 +559,8 @@ SAM: Power: -20 Footprint: xx Dimensions: 2,1 + RequiresPower: + DisabledOverlay: -GivesBuildableArea: Health: HP: 400 @@ -581,7 +582,6 @@ SAM: RenderRangeCircle: OBLI: - RequiresPower: Inherits: ^Building Valued: Cost: 1500 @@ -599,6 +599,8 @@ OBLI: Power: -150 Footprint: _ x Dimensions: 1,2 + RequiresPower: + DisabledOverlay: -GivesBuildableArea: Health: HP: 600 @@ -666,7 +668,6 @@ GTWR: ATWR: Inherits: ^Building - RequiresPower: Valued: Cost: 1000 CustomBuildTimeValue: @@ -683,6 +684,8 @@ ATWR: Power: -40 Footprint: _ x Dimensions: 1,2 + RequiresPower: + DisabledOverlay: -GivesBuildableArea: Health: HP: 600 From 4f9f258413ebde7c80666097435964c2cdc4b7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 3 Apr 2014 07:22:39 +0200 Subject: [PATCH 2/2] automatic upgrade rules for new DisabledOverlay --- OpenRA.Utility/UpgradeRules.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index 7105d21b51..73ac70061e 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -222,6 +222,16 @@ namespace OpenRA.Utility } } + // "disabled" palette overlay has been moved into it's own DisabledOverlay trait + if (engineVersion < 20140305) + { + if (node.Value.Nodes.Any(n => n.Key.StartsWith("RequiresPower")) + && !node.Value.Nodes.Any(n => n.Key.StartsWith("DisabledOverlay"))) + { + node.Value.Nodes.Add(new MiniYamlNode("DisabledOverlay", new MiniYaml(""))); + } + } + // ChronoshiftDeploy was replaced with PortableChrono if (engineVersion < 20140321) {