From c7b61799dc2607dc87c472497d9834341a96bb58 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sun, 27 Dec 2015 21:12:38 +0100 Subject: [PATCH] Make Bullet and Missile contrail ZOffset customizable And give them a high default to avoid contrails "hiding" below large sprites. --- OpenRA.Mods.Common/Effects/Bullet.cs | 3 ++- OpenRA.Mods.Common/Effects/Missile.cs | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index 77efeafb56..ea5a9dd998 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -63,6 +63,7 @@ namespace OpenRA.Mods.Common.Effects public readonly bool TrailUsePlayerPalette = false; public readonly int ContrailLength = 0; + public readonly int ContrailZOffset = 2047; public readonly Color ContrailColor = Color.White; public readonly bool ContrailUsePlayerColor = false; public readonly int ContrailDelay = 1; @@ -128,7 +129,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.ContrailWidth, info.ContrailLength, info.ContrailDelay, 0); + contrail = new ContrailRenderable(world, color, info.ContrailWidth, info.ContrailLength, info.ContrailDelay, info.ContrailZOffset); } trailPalette = info.TrailPalette; diff --git a/OpenRA.Mods.Common/Effects/Missile.cs b/OpenRA.Mods.Common/Effects/Missile.cs index 262e5e100a..cbed05e4f8 100644 --- a/OpenRA.Mods.Common/Effects/Missile.cs +++ b/OpenRA.Mods.Common/Effects/Missile.cs @@ -105,6 +105,8 @@ namespace OpenRA.Mods.Common.Effects public readonly int ContrailLength = 0; + public readonly int ContrailZOffset = 2047; + public readonly WDist ContrailWidth = new WDist(64); public readonly Color ContrailColor = Color.White; @@ -211,7 +213,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.ContrailWidth, info.ContrailLength, info.ContrailDelay, 0); + contrail = new ContrailRenderable(world, color, info.ContrailWidth, info.ContrailLength, info.ContrailDelay, info.ContrailZOffset); } trailPalette = info.TrailPalette;