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

@@ -50,7 +50,13 @@ namespace OpenRA.Mods.Common.Widgets
{
// TODO: Integrate this with SelectionDecorations to unhardcode the *Renderable
if (unit.Info.HasTraitInfo<SelectableInfo>())
new SelectionBarsRenderable(unit, true, true).Render(worldRenderer);
{
var bounds = unit.TraitsImplementing<IDecorationBounds>()
.Select(b => b.DecorationBounds(unit, worldRenderer))
.FirstOrDefault(b => !b.IsEmpty);
new SelectionBarsRenderable(unit, bounds, true, true).Render(worldRenderer);
}
}
public override void Draw()