Skip to content

Commit

Permalink
fix TS power down palette
Browse files Browse the repository at this point in the history
  • Loading branch information
Mailaender committed Apr 16, 2015
1 parent af1dfd3 commit 18fda23
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
6 changes: 3 additions & 3 deletions OpenRA.Mods.Common/Effects/PowerdownIndicator.cs
Expand Up @@ -26,8 +26,8 @@ public PowerdownIndicator(Actor a)
this.a = a;
canPowerDown = a.Trait<CanPowerDown>();

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)
Expand All @@ -43,7 +43,7 @@ public IEnumerable<IRenderable> Render(WorldRenderer wr)
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));
}
}
}
5 changes: 5 additions & 0 deletions OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs
Expand Up @@ -19,6 +19,11 @@ public class CanPowerDownInfo : UpgradableTraitInfo, ITraitInfo, Requires<PowerI
[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); }
}

Expand Down
6 changes: 6 additions & 0 deletions mods/ts/rules/structures.yaml
Expand Up @@ -682,6 +682,7 @@ GARADR:
Type: Wood
RequiresPower:
CanPowerDown:
IndicatorPalette: mouse
ProvidesRadar:
InfiltrateForExploration:
DetectCloaked:
Expand Down Expand Up @@ -721,6 +722,7 @@ NARADR:
Type: Wood
RequiresPower:
CanPowerDown:
IndicatorPalette: mouse
ProvidesRadar:
InfiltrateForExploration:
DetectCloaked:
Expand Down Expand Up @@ -941,6 +943,7 @@ NASTLH:
Amount: -350
RequiresPower:
CanPowerDown:
IndicatorPalette: mouse
UpgradeActorsNear:
Upgrades: cloakgenerator
Range: 12c0
Expand Down Expand Up @@ -988,6 +991,7 @@ GACTWR:
UpgradeTypes: tower
UpgradeMinEnabledLevel: 1
CanPowerDown:
IndicatorPalette: mouse
WithTurret@VULC:
UpgradeTypes: tower.vulcan
UpgradeMinEnabledLevel: 1
Expand Down Expand Up @@ -1299,6 +1303,7 @@ NAMISL:
Power:
Amount: -50
CanPowerDown:
IndicatorPalette: mouse
RequiresPower:
DisabledOverlay:
SupportPowerChargeBar:
Expand Down Expand Up @@ -1339,6 +1344,7 @@ GAPLUG:
Dimensions: 2,3
RequiresPower:
CanPowerDown:
IndicatorPalette: mouse
DisabledOverlay:
RenderBuilding:
WithIdleOverlay@DISH:
Expand Down
3 changes: 3 additions & 0 deletions mods/ts/rules/world.yaml
Expand Up @@ -10,6 +10,9 @@ World:
BuildingInfluence:
ProductionQueueFromSelection:
ProductionPaletteWidget: PRODUCTION_PALETTE
PaletteFromFile@mouse:
Name: mouse
Filename: mousepal.pal
PaletteFromFile@playersno:
Name: player
Tileset: SNOW
Expand Down

0 comments on commit 18fda23

Please sign in to comment.