Use RgbaColorRenderer for rendering contrails.
This commit is contained in:
@@ -66,6 +66,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
public readonly Color ContrailColor = Color.White;
|
||||
public readonly bool ContrailUsePlayerColor = false;
|
||||
public readonly int ContrailDelay = 1;
|
||||
public readonly WDist ContrailWidth = new WDist(64);
|
||||
|
||||
public IEffect Create(ProjectileArgs args) { return new Bullet(this, args); }
|
||||
}
|
||||
@@ -127,7 +128,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
if (info.ContrailLength > 0)
|
||||
{
|
||||
var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
|
||||
contrail = new ContrailRenderable(world, color, info.ContrailLength, info.ContrailDelay, 0);
|
||||
contrail = new ContrailRenderable(world, color, info.ContrailWidth, info.ContrailLength, info.ContrailDelay, 0);
|
||||
}
|
||||
|
||||
trailPalette = info.TrailPalette;
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace OpenRA.Mods.Common.Effects
|
||||
[Desc("Length of the trail (in ticks).")]
|
||||
public readonly int TrailLength = 25;
|
||||
|
||||
[Desc("Width of the trail.")]
|
||||
public readonly WDist TrailWidth = new WDist(64);
|
||||
|
||||
[Desc("RGB color of the contrail.")]
|
||||
public readonly Color Color = Color.White;
|
||||
|
||||
@@ -48,7 +51,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
this.info = info;
|
||||
|
||||
var color = info.UsePlayerColor ? ContrailRenderable.ChooseColor(self) : info.Color;
|
||||
trail = new ContrailRenderable(self.World, color, info.TrailLength, 0, 0);
|
||||
trail = new ContrailRenderable(self.World, color, info.TrailWidth, info.TrailLength, 0, 0);
|
||||
|
||||
body = self.Trait<BodyOrientation>();
|
||||
}
|
||||
|
||||
@@ -105,6 +105,8 @@ namespace OpenRA.Mods.Common.Effects
|
||||
|
||||
public readonly int ContrailLength = 0;
|
||||
|
||||
public readonly WDist ContrailWidth = new WDist(64);
|
||||
|
||||
public readonly Color ContrailColor = Color.White;
|
||||
|
||||
public readonly bool ContrailUsePlayerColor = false;
|
||||
@@ -209,7 +211,7 @@ namespace OpenRA.Mods.Common.Effects
|
||||
if (info.ContrailLength > 0)
|
||||
{
|
||||
var color = info.ContrailUsePlayerColor ? ContrailRenderable.ChooseColor(args.SourceActor) : info.ContrailColor;
|
||||
contrail = new ContrailRenderable(world, color, info.ContrailLength, info.ContrailDelay, 0);
|
||||
contrail = new ContrailRenderable(world, color, info.ContrailWidth, info.ContrailLength, info.ContrailDelay, 0);
|
||||
}
|
||||
|
||||
trailPalette = info.TrailPalette;
|
||||
|
||||
Reference in New Issue
Block a user