Implemented trait defined Rollovers.
This commit is contained in:
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public object Create(ActorInitializer init) { return new SelectionDecorations(init.Self, this); }
|
||||
}
|
||||
|
||||
public class SelectionDecorations : IRenderAboveShroud, INotifyCreated, ITick
|
||||
public class SelectionDecorations : ISelectionDecorations, IRenderAboveShroud, INotifyCreated, ITick
|
||||
{
|
||||
// depends on the order of pips in TraitsInterfaces.cs!
|
||||
static readonly string[] PipStrings = { "pip-empty", "pip-green", "pip-yellow", "pip-red", "pip-gray", "pip-blue", "pip-ammo", "pip-ammoempty" };
|
||||
@@ -121,6 +121,12 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
yield return r;
|
||||
}
|
||||
|
||||
public void DrawRollover(Actor self, WorldRenderer worldRenderer)
|
||||
{
|
||||
var bounds = decorationBounds.FirstNonEmptyBounds(self, worldRenderer);
|
||||
new SelectionBarsRenderable(self, bounds, true, true).Render(worldRenderer);
|
||||
}
|
||||
|
||||
IEnumerable<IRenderable> DrawPips(Actor self, Rectangle bounds, WorldRenderer wr)
|
||||
{
|
||||
if (pipSources.Length == 0)
|
||||
|
||||
Reference in New Issue
Block a user