fixes #82
This commit is contained in:
@@ -50,6 +50,7 @@ namespace OpenRa.Game.GameRules
|
||||
public readonly int[] PrimaryOffset = { 0, 0 };
|
||||
public readonly int[] SecondaryOffset = null;
|
||||
public readonly int Recoil = 0;
|
||||
public readonly string SecondaryAnim = null;
|
||||
|
||||
public UnitInfo(string name) { Name = name; }
|
||||
|
||||
|
||||
@@ -8,13 +8,19 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
class RenderUnitRotor : RenderUnit
|
||||
{
|
||||
public Animation rotorAnim;
|
||||
public Animation rotorAnim, secondRotorAnim;
|
||||
|
||||
public RenderUnitRotor( Actor self )
|
||||
: base(self)
|
||||
{
|
||||
rotorAnim = new Animation(self.unitInfo.Name);
|
||||
rotorAnim.PlayRepeating("rotor");
|
||||
|
||||
if (self.unitInfo.SecondaryAnim != null)
|
||||
{
|
||||
secondRotorAnim = new Animation(self.unitInfo.Name);
|
||||
rotorAnim.PlayRepeating(self.unitInfo.SecondaryAnim);
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<Pair<Sprite, float2>> Render(Actor self)
|
||||
@@ -25,7 +31,7 @@ namespace OpenRa.Game.Traits
|
||||
yield return Util.Centered(rotorAnim.Image, self.CenterLocation
|
||||
+ Util.GetTurretPosition(self, self.unitInfo.PrimaryOffset, 0));
|
||||
if (self.unitInfo.SecondaryOffset != null)
|
||||
yield return Util.Centered(rotorAnim.Image, self.CenterLocation
|
||||
yield return Util.Centered((secondRotorAnim ?? rotorAnim).Image, self.CenterLocation
|
||||
+ Util.GetTurretPosition(self, self.unitInfo.SecondaryOffset, 0));
|
||||
}
|
||||
|
||||
@@ -33,6 +39,8 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
base.Tick(self);
|
||||
rotorAnim.Tick();
|
||||
if (secondRotorAnim != null)
|
||||
secondRotorAnim.Tick();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,6 +499,9 @@
|
||||
<unit name="tran">
|
||||
<sequence name="idle" start="0" length="32" />
|
||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||
<sequence name="rotor2" start="0" length="4" src="rrotor" />
|
||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||
<sequence name="slow-rotor2" start="4" length="8" src="rrotor" />
|
||||
</unit>
|
||||
<unit name="v2">
|
||||
<sequence name="idle" start="0" length="32" />
|
||||
|
||||
Reference in New Issue
Block a user