better support for contrail coloring everywhere

This commit is contained in:
Chris Forbes
2011-04-10 10:37:09 +12:00
parent 79079ebe07
commit d2d0e4be96
3 changed files with 6 additions and 3 deletions

View File

@@ -32,6 +32,7 @@ namespace OpenRA.Mods.RA.Effects
public readonly float Angle = 0; public readonly float Angle = 0;
public readonly int TrailInterval = 2; public readonly int TrailInterval = 2;
public readonly int ContrailLength = 0; public readonly int ContrailLength = 0;
public readonly Color ContrailColor = Color.White;
public readonly bool ContrailUsePlayerColor = false; public readonly bool ContrailUsePlayerColor = false;
public readonly int ContrailDelay = 1; public readonly int ContrailDelay = 1;
@@ -69,7 +70,7 @@ namespace OpenRA.Mods.RA.Effects
if (Info.ContrailLength > 0) if (Info.ContrailLength > 0)
{ {
Trail = new ContrailHistory(Info.ContrailLength, Trail = new ContrailHistory(Info.ContrailLength,
Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Color.White, Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Info.ContrailColor,
Info.ContrailDelay); Info.ContrailDelay);
} }
} }

View File

@@ -21,6 +21,7 @@ namespace OpenRA.Mods.RA
public readonly int[] ContrailOffset = {0, 0}; public readonly int[] ContrailOffset = {0, 0};
public readonly int TrailLength = 20; public readonly int TrailLength = 20;
public readonly Color Color = Color.White;
public readonly bool UsePlayerColor = true; public readonly bool UsePlayerColor = true;
public object Create(ActorInitializer init) { return new Contrail(init.self, this); } public object Create(ActorInitializer init) { return new Contrail(init.self, this); }
@@ -38,7 +39,7 @@ namespace OpenRA.Mods.RA
{ {
Info = info; Info = info;
ContrailTurret = new Turret(Info.ContrailOffset); ContrailTurret = new Turret(Info.ContrailOffset);
history = new ContrailHistory(Info.TrailLength, Info.UsePlayerColor ? ContrailHistory.ChooseColor(self) : Color.White); history = new ContrailHistory(Info.TrailLength, Info.UsePlayerColor ? ContrailHistory.ChooseColor(self) : Info.Color);
} }
public void Tick(Actor self) public void Tick(Actor self)

View File

@@ -34,6 +34,7 @@ namespace OpenRA.Mods.RA.Effects
public readonly bool TurboBoost = false; public readonly bool TurboBoost = false;
public readonly int TrailInterval = 2; public readonly int TrailInterval = 2;
public readonly int ContrailLength = 0; public readonly int ContrailLength = 0;
public readonly Color ContrailColor = Color.White;
public readonly bool ContrailUsePlayerColor = false; public readonly bool ContrailUsePlayerColor = false;
public readonly int ContrailDelay = 1; public readonly int ContrailDelay = 1;
@@ -76,7 +77,7 @@ namespace OpenRA.Mods.RA.Effects
if (Info.ContrailLength > 0) if (Info.ContrailLength > 0)
{ {
Trail = new ContrailHistory(Info.ContrailLength, Trail = new ContrailHistory(Info.ContrailLength,
Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Color.White, Info.ContrailUsePlayerColor ? ContrailHistory.ChooseColor(args.firedBy) : Info.ContrailColor,
Info.ContrailDelay); Info.ContrailDelay);
} }
} }