more ported bits
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRa.Game.Graphics;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderUnitSpinnerInfo : RenderUnitInfo
|
||||
{
|
||||
public readonly int[] Offset = { 0, 0 };
|
||||
public override object Create(Actor self) { return new RenderUnitSpinner(self); }
|
||||
}
|
||||
|
||||
@@ -14,12 +16,13 @@ namespace OpenRa.Game.Traits
|
||||
: base(self)
|
||||
{
|
||||
var unit = self.traits.Get<Unit>();
|
||||
var info = self.Info.Traits.Get<RenderUnitSpinnerInfo>();
|
||||
|
||||
var spinnerAnim = new Animation( self.LegacyInfo.Name );
|
||||
var spinnerAnim = new Animation( info.Image ?? self.Info.Name );
|
||||
spinnerAnim.PlayRepeating( "spinner" );
|
||||
anims.Add( "spinner", new AnimationWithOffset(
|
||||
spinnerAnim,
|
||||
() => Util.GetTurretPosition( self, unit, self.LegacyInfo.PrimaryOffset, 0 ),
|
||||
() => Util.GetTurretPosition( self, unit, info.Offset, 0 ),
|
||||
null ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user