From e8493ab855e945621c5d8416de3b85d0b4b56736 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Wed, 15 Apr 2015 07:23:20 +0200 Subject: [PATCH] fix TS power down palette --- OpenRA.Mods.Common/Effects/PowerdownIndicator.cs | 6 +++--- OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs | 5 +++++ mods/ts/rules/gdi-structures.yaml | 2 ++ mods/ts/rules/gdi-support.yaml | 1 + mods/ts/rules/nod-structures.yaml | 2 ++ mods/ts/rules/nod-support.yaml | 1 + mods/ts/rules/world.yaml | 3 +++ 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs b/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs index a2bc6eadb1..735c9aa3c2 100644 --- a/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs +++ b/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs @@ -26,8 +26,8 @@ namespace OpenRA.Mods.Common.Effects this.a = a; canPowerDown = a.Trait(); - anim = new Animation(a.World, "poweroff"); - anim.PlayRepeating("offline"); + anim = new Animation(a.World, canPowerDown.Info.IndicatorImage); + anim.PlayRepeating(canPowerDown.Info.IndicatorSequence); } public void Tick(World world) @@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Effects if (a.Destroyed || wr.World.FogObscures(a)) return SpriteRenderable.None; - return anim.Render(a.CenterPosition, wr.Palette("chrome")); + return anim.Render(a.CenterPosition, wr.Palette(canPowerDown.Info.IndicatorPalette)); } } } diff --git a/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs b/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs index 4f3c9db2a4..b6902f44b1 100644 --- a/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs +++ b/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs @@ -19,6 +19,11 @@ namespace OpenRA.Mods.Common.Traits [Desc("Restore power when this trait is disabled.")] public readonly bool CancelWhenDisabled = false; + public readonly string IndicatorImage = "poweroff"; + public readonly string IndicatorSequence = "offline"; + + public readonly string IndicatorPalette = "chrome"; + public object Create(ActorInitializer init) { return new CanPowerDown(init.Self, this); } } diff --git a/mods/ts/rules/gdi-structures.yaml b/mods/ts/rules/gdi-structures.yaml index a40e608153..1b03d331f0 100644 --- a/mods/ts/rules/gdi-structures.yaml +++ b/mods/ts/rules/gdi-structures.yaml @@ -247,6 +247,7 @@ GARADR: Type: Wood RequiresPower: CanPowerDown: + IndicatorPalette: mouse ProvidesRadar: InfiltrateForExploration: DetectCloaked: @@ -309,6 +310,7 @@ GAPLUG: Dimensions: 2,3 RequiresPower: CanPowerDown: + IndicatorPalette: mouse DisabledOverlay: RenderBuilding: WithIdleOverlay@DISH: diff --git a/mods/ts/rules/gdi-support.yaml b/mods/ts/rules/gdi-support.yaml index 65c28b3421..3bc5de8e24 100644 --- a/mods/ts/rules/gdi-support.yaml +++ b/mods/ts/rules/gdi-support.yaml @@ -62,6 +62,7 @@ GACTWR: UpgradeTypes: tower UpgradeMinEnabledLevel: 1 CanPowerDown: + IndicatorPalette: mouse WithTurret@VULC: UpgradeTypes: tower.vulcan UpgradeMinEnabledLevel: 1 diff --git a/mods/ts/rules/nod-structures.yaml b/mods/ts/rules/nod-structures.yaml index 94adaff8f4..cb00f54168 100644 --- a/mods/ts/rules/nod-structures.yaml +++ b/mods/ts/rules/nod-structures.yaml @@ -211,6 +211,7 @@ NARADR: Type: Wood RequiresPower: CanPowerDown: + IndicatorPalette: mouse ProvidesRadar: InfiltrateForExploration: DetectCloaked: @@ -285,6 +286,7 @@ NASTLH: Amount: -350 RequiresPower: CanPowerDown: + IndicatorPalette: mouse UpgradeActorsNear: Upgrades: cloakgenerator Range: 12c0 diff --git a/mods/ts/rules/nod-support.yaml b/mods/ts/rules/nod-support.yaml index 28035db4cf..14b887cd2b 100644 --- a/mods/ts/rules/nod-support.yaml +++ b/mods/ts/rules/nod-support.yaml @@ -274,6 +274,7 @@ NAMISL: Power: Amount: -50 CanPowerDown: + IndicatorPalette: mouse RequiresPower: DisabledOverlay: SupportPowerChargeBar: diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index 28c4ba49ab..3749d70929 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -10,6 +10,9 @@ World: BuildingInfluence: ProductionQueueFromSelection: ProductionPaletteWidget: PRODUCTION_PALETTE + PaletteFromFile@mouse: + Name: mouse + Filename: mousepal.pal PaletteFromFile@playersno: Name: player Tileset: SNOW