Add ContrailEndWidth

This commit is contained in:
Gustas
2022-10-06 14:08:15 +03:00
committed by Matthias Mailänder
parent ff488b77b5
commit 7ef1dccdcf
6 changed files with 86 additions and 20 deletions

View File

@@ -139,8 +139,11 @@ namespace OpenRA.Mods.Common.Projectiles
[Desc("Equivalent to sequence ZOffset. Controls Z sorting.")]
public readonly int ContrailZOffset = 2047;
[Desc("Thickness of the emitted line.")]
public readonly WDist ContrailWidth = new(64);
[Desc("Thickness of the emitted line at the start of the contrail.")]
public readonly WDist ContrailStartWidth = new(64);
[Desc("Thickness of the emitted line at the end of the contrail. Will default to " + nameof(ContrailStartWidth) + " if left undefined")]
public readonly WDist? ContrailEndWidth = null;
[Desc("RGB color at the contrail start.")]
public readonly Color ContrailStartColor = Color.White;
@@ -284,7 +287,7 @@ namespace OpenRA.Mods.Common.Projectiles
{
var startcolor = info.ContrailStartColorUsePlayerColor ? Color.FromArgb(info.ContrailStartColorAlpha, args.SourceActor.Owner.Color) : Color.FromArgb(info.ContrailStartColorAlpha, info.ContrailStartColor);
var endcolor = info.ContrailEndColorUsePlayerColor ? Color.FromArgb(info.ContrailEndColorAlpha, args.SourceActor.Owner.Color) : Color.FromArgb(info.ContrailEndColorAlpha, info.ContrailEndColor ?? startcolor);
contrail = new ContrailRenderable(world, startcolor, endcolor, info.ContrailWidth, info.ContrailLength, info.ContrailDelay, info.ContrailZOffset);
contrail = new ContrailRenderable(world, startcolor, endcolor, info.ContrailStartWidth, info.ContrailEndWidth ?? info.ContrailStartWidth, info.ContrailLength, info.ContrailDelay, info.ContrailZOffset);
}
trailPalette = info.TrailPalette;