Rework decoration renderable traits:

- Removed implicit pip definitions and IPips interface.
  New decoration traits have been added to render them.
  Pip types are no longer hardcoded in OpenRA.Game.

- Decoration rendering is now managed by SelectionDecorations(Base),
  which allows us to remove assumptions about the selection box
  geometry from the decoration traits.

- RenderNameTag has been replaced by WithNameTagDecoration, which is
  an otherwise normal decoration trait.

- Unify the configuration and reduce duplication between traits.

- Removed hardcoded references to specific selection box renderables.

- Remove legacy cruft.
This commit is contained in:
Paul Chote
2020-03-09 19:56:31 +00:00
committed by atlimit8
parent 73a78eadb1
commit ac200f6173
31 changed files with 1377 additions and 686 deletions

View File

@@ -146,8 +146,9 @@ namespace OpenRA.Mods.Common.Traits
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
foreach (var unit in power.UnitsInRange(xy))
{
var bounds = unit.TraitsImplementing<IDecorationBounds>().FirstNonEmptyBounds(unit, wr);
yield return new SelectionBoxAnnotationRenderable(unit, bounds, Color.Red);
var decorations = unit.TraitsImplementing<ISelectionDecorations>().FirstEnabledTraitOrDefault();
foreach (var d in decorations.RenderSelectionAnnotations(unit, wr, Color.Red))
yield return d;
}
}