Introduce IDecorationBounds to replace Actor.SelectionOverlayBounds.

This commit is contained in:
Paul Chote
2017-12-08 17:31:36 +00:00
committed by reaperrr
parent 6f5d035e79
commit ff5b4b15b3
15 changed files with 148 additions and 64 deletions

View File

@@ -134,7 +134,12 @@ namespace OpenRA.Mods.Common.Traits
{
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
foreach (var unit in power.UnitsInRange(xy))
yield return new SelectionBoxRenderable(unit, Color.Red);
{
var bounds = unit.TraitsImplementing<IDecorationBounds>()
.Select(b => b.DecorationBounds(unit, wr))
.FirstOrDefault(b => !b.IsEmpty);
yield return new SelectionBoxRenderable(unit, bounds, Color.Red);
}
}
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)