Aftermath support, and spinners (on MGG, MRJ, TTNK) work (again?).
This commit is contained in:
35
OpenRa.Game/Traits/RenderUnitSpinner.cs
Executable file
35
OpenRa.Game/Traits/RenderUnitSpinner.cs
Executable file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRa.Game.Graphics;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderUnitSpinner : RenderUnit
|
||||
{
|
||||
public Animation spinnerAnim;
|
||||
|
||||
public RenderUnitSpinner( Actor self )
|
||||
: base(self)
|
||||
{
|
||||
spinnerAnim = new Animation( self.unitInfo.Name );
|
||||
spinnerAnim.PlayRepeating( "spinner" );
|
||||
}
|
||||
|
||||
public override IEnumerable<Tuple<Sprite, float2, int>> Render(Actor self)
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
|
||||
yield return Util.Centered(self, anim.Image, self.CenterLocation);
|
||||
yield return Util.Centered( self, spinnerAnim.Image, self.CenterLocation
|
||||
+ Util.GetTurretPosition(self, unit, self.unitInfo.PrimaryOffset, 0));
|
||||
}
|
||||
|
||||
public override void Tick(Actor self)
|
||||
{
|
||||
base.Tick(self);
|
||||
spinnerAnim.Tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user