diff --git a/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs b/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs index 238da6230c..8511e678ec 100644 --- a/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs +++ b/OpenRA.Mods.Common/Traits/CombatDebugOverlay.cs @@ -27,11 +27,15 @@ namespace OpenRA.Mods.Common.Traits public class CombatDebugOverlay : IRenderAboveWorld, INotifyDamage, INotifyCreated { + static readonly WVec TargetPosHLine = new WVec(0, 128, 0); + static readonly WVec TargetPosVLine = new WVec(128, 0, 0); + readonly DeveloperMode devMode; readonly HealthInfo healthInfo; readonly Lazy coords; IBlocksProjectiles[] allBlockers; + ITargetablePositions[] targetablePositions; public CombatDebugOverlay(Actor self) { @@ -45,6 +49,7 @@ namespace OpenRA.Mods.Common.Traits void INotifyCreated.Created(Actor self) { allBlockers = self.TraitsImplementing().ToArray(); + targetablePositions = self.TraitsImplementing().ToArray(); } void IRenderAboveWorld.RenderAboveWorld(Actor self, WorldRenderer wr) @@ -70,6 +75,17 @@ namespace OpenRA.Mods.Common.Traits TargetLineRenderable.DrawTargetMarker(wr, hc, hb); } + var tc = Color.Lime; + var enabledPositions = targetablePositions.Where(Exts.IsTraitEnabled); + var positions = enabledPositions.SelectMany(tp => tp.TargetablePositions(self)); + foreach (var p in positions) + { + var center = wr.Screen3DPosition(p); + TargetLineRenderable.DrawTargetMarker(wr, tc, center); + wcr.DrawLine(wr.Screen3DPosition(p - TargetPosHLine), wr.Screen3DPosition(p + TargetPosHLine), iz, tc); + wcr.DrawLine(wr.Screen3DPosition(p - TargetPosVLine), wr.Screen3DPosition(p + TargetPosVLine), iz, tc); + } + foreach (var attack in self.TraitsImplementing().Where(x => !x.IsTraitDisabled)) DrawArmaments(self, attack, wr, wcr, iz); }