internal machinery for contrails on missiles

This commit is contained in:
Chris Forbes
2011-04-09 17:57:00 +12:00
parent 6710ad975e
commit 5fd3cc7977
2 changed files with 21 additions and 7 deletions

View File

@@ -34,17 +34,11 @@ namespace OpenRA.Mods.RA
ContrailHistory history;
static Color ChooseColor(Actor self)
{
var ownerColor = Color.FromArgb(255, self.Owner.ColorRamp.GetColor(0));
return PlayerColorRemap.ColorLerp(0.5f, ownerColor, Color.White);
}
public Contrail(Actor self, ContrailInfo info)
{
Info = info;
ContrailTurret = new Turret(Info.ContrailOffset);
history = new ContrailHistory(Info.TrailLength, Info.UsePlayerColor ? ChooseColor(self) : Color.White);
history = new ContrailHistory(Info.TrailLength, Info.UsePlayerColor ? ContrailHistory.ChooseColor(self) : Color.White);
}
public void Tick(Actor self)
@@ -65,6 +59,12 @@ namespace OpenRA.Mods.RA
readonly int TrailLength;
readonly Color Color;
public static Color ChooseColor(Actor self)
{
var ownerColor = Color.FromArgb(255, self.Owner.ColorRamp.GetColor(0));
return PlayerColorRemap.ColorLerp(0.5f, ownerColor, Color.White);
}
public ContrailHistory(int trailLength, Color color)
{
this.TrailLength = trailLength;