Introduce IDecorationBounds to replace Actor.SelectionOverlayBounds.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user