Convert CombatDebugOverlay to IRenderAboveShroud.

This commit is contained in:
Paul Chote
2019-09-03 21:05:04 +01:00
committed by teinarss
parent c9ed749908
commit 60e42c1ea1
6 changed files with 51 additions and 63 deletions

View File

@@ -10,6 +10,7 @@
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Primitives;
@@ -57,14 +58,11 @@ namespace OpenRA.Mods.Common.HitShapes
return DistanceFromEdge(pos - new WPos(actorPos.X, actorPos.Y, pos.Z));
}
public void DrawCombatOverlay(WorldRenderer wr, RgbaColorRenderer wcr, Actor actor)
IEnumerable<IRenderable> IHitShape.RenderDebugOverlay(WorldRenderer wr, Actor actor)
{
var actorPos = actor.CenterPosition;
RangeCircleRenderable.DrawRangeCircle(
wr, actorPos + new WVec(0, 0, VerticalTopOffset), Radius, 1, Color.Yellow, 0, Color.Yellow);
RangeCircleRenderable.DrawRangeCircle(
wr, actorPos + new WVec(0, 0, VerticalBottomOffset), Radius, 1, Color.Yellow, 0, Color.Yellow);
yield return new CircleAnnotationRenderable(actorPos + new WVec(0, 0, VerticalTopOffset), Radius, 1, Color.Yellow);
yield return new CircleAnnotationRenderable(actorPos + new WVec(0, 0, VerticalBottomOffset), Radius, 1, Color.Yellow);
}
}
}