facings for the rest of mods/ra.
This commit is contained in:
@@ -13,7 +13,12 @@ namespace OpenRa.Traits
|
|||||||
static readonly int[] bibStarts = { 0, 0, 1, 5, 11 };
|
static readonly int[] bibStarts = { 0, 0, 1, 5, 11 };
|
||||||
|
|
||||||
public RenderBuilding( Actor self )
|
public RenderBuilding( Actor self )
|
||||||
: base(self)
|
: this( self, () => 0 )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public RenderBuilding(Actor self, Func<int> baseFacing)
|
||||||
|
: base(self, baseFacing)
|
||||||
{
|
{
|
||||||
if( Game.skipMakeAnims )
|
if( Game.skipMakeAnims )
|
||||||
Complete( self );
|
Complete( self );
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace OpenRa.Traits
|
|||||||
class RenderBuildingTurreted : RenderBuilding, INotifyBuildComplete
|
class RenderBuildingTurreted : RenderBuilding, INotifyBuildComplete
|
||||||
{
|
{
|
||||||
public RenderBuildingTurreted(Actor self)
|
public RenderBuildingTurreted(Actor self)
|
||||||
: base(self)
|
: base(self, () => self.traits.Get<Turreted>().turretFacing)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,8 @@ namespace OpenRa.Traits
|
|||||||
public class RenderInfantry : RenderSimple, INotifyAttack, INotifyDamage
|
public class RenderInfantry : RenderSimple, INotifyAttack, INotifyDamage
|
||||||
{
|
{
|
||||||
public RenderInfantry(Actor self)
|
public RenderInfantry(Actor self)
|
||||||
: base(self)
|
: base(self, () => self.traits.Get<Unit>().Facing)
|
||||||
{
|
{
|
||||||
anim = new Animation( GetImage( self ), () => self.traits.Get<Unit>().Facing );
|
|
||||||
anim.PlayFacing("stand",
|
anim.PlayFacing("stand",
|
||||||
() => self.traits.Get<Unit>().Facing);
|
() => self.traits.Get<Unit>().Facing);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,9 @@ namespace OpenRa.Traits
|
|||||||
return self.Info.Traits.Get<RenderSimpleInfo>().Image ?? self.Info.Name;
|
return self.Info.Traits.Get<RenderSimpleInfo>().Image ?? self.Info.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RenderSimple(Actor self)
|
public RenderSimple(Actor self, Func<int> baseFacing)
|
||||||
{
|
{
|
||||||
anims.Add( "", new Animation( GetImage(self) ) );
|
anims.Add( "", new Animation( GetImage(self), baseFacing ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual IEnumerable<Renderable> Render( Actor self )
|
public virtual IEnumerable<Renderable> Render( Actor self )
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ namespace OpenRa.Traits
|
|||||||
class RenderUnit : RenderSimple, INotifyDamage
|
class RenderUnit : RenderSimple, INotifyDamage
|
||||||
{
|
{
|
||||||
public RenderUnit(Actor self)
|
public RenderUnit(Actor self)
|
||||||
: base(self)
|
: base(self, () => self.traits.Get<Unit>().Facing)
|
||||||
{
|
{
|
||||||
anim = new Animation( GetImage( self ), () => self.traits.Get<Unit>().Facing );
|
|
||||||
PlayFacingAnim(self);
|
PlayFacingAnim(self);
|
||||||
|
|
||||||
anims.Add( "smoke", new AnimationWithOffset( new Animation( "smoke_m" ), null, () => !isSmoking ) );
|
anims.Add( "smoke", new AnimationWithOffset( new Animation( "smoke_m" ), null, () => !isSmoking ) );
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ namespace OpenRa.Traits
|
|||||||
var attack = self.traits.Get<AttackBase>();
|
var attack = self.traits.Get<AttackBase>();
|
||||||
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
|
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
|
||||||
|
|
||||||
var muzzleFlash = new Animation(GetImage(self));
|
var muzzleFlash = new Animation(GetImage(self), ()=>unit.Facing);
|
||||||
muzzleFlash.PlayFetchIndex("muzzle",
|
muzzleFlash.PlayFetchIndex("muzzle",
|
||||||
() => (Util.QuantizeFacing(unit.Facing, 8)) * 6 + (int)(attack.primaryRecoil * 5.9f));
|
() => (int)(attack.primaryRecoil * 5.9f));
|
||||||
anims.Add( "muzzle", new AnimationWithOffset(
|
anims.Add( "muzzle", new AnimationWithOffset(
|
||||||
muzzleFlash,
|
muzzleFlash,
|
||||||
() => attackInfo.PrimaryOffset.AbsOffset(),
|
() => attackInfo.PrimaryOffset.AbsOffset(),
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace OpenRa.Traits
|
|||||||
var attack = self.traits.GetOrDefault<AttackBase>();
|
var attack = self.traits.GetOrDefault<AttackBase>();
|
||||||
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
|
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
|
||||||
|
|
||||||
var turretAnim = new Animation(GetImage(self));
|
var turretAnim = new Animation(GetImage(self), () => turreted.turretFacing );
|
||||||
turretAnim.PlayFacing( "turret", () => turreted.turretFacing );
|
turretAnim.PlayFacing( "turret", () => turreted.turretFacing );
|
||||||
|
|
||||||
if( attackInfo.PrimaryOffset != null )
|
if( attackInfo.PrimaryOffset != null )
|
||||||
@@ -36,10 +36,9 @@ namespace OpenRa.Traits
|
|||||||
|
|
||||||
if( attackInfo.MuzzleFlash )
|
if( attackInfo.MuzzleFlash )
|
||||||
{
|
{
|
||||||
var muzzleFlash = new Animation( GetImage(self) );
|
var muzzleFlash = new Animation( GetImage(self), () => self.traits.Get<Turreted>().turretFacing );
|
||||||
muzzleFlash.PlayFetchIndex( "muzzle",
|
muzzleFlash.PlayFetchIndex( "muzzle",
|
||||||
() => ( Util.QuantizeFacing( self.traits.Get<Turreted>().turretFacing, 8 ) ) * 6
|
() => (int)( attack.primaryRecoil * 5.9f ) ); /* hack: recoil can be 1.0f, but don't overflow into next anim */
|
||||||
+ (int)( attack.primaryRecoil * 5.9f ) ); /* hack: recoil can be 1.0f, but don't overflow into next anim */
|
|
||||||
anims.Add( "muzzle_flash", new AnimationWithOffset(
|
anims.Add( "muzzle_flash", new AnimationWithOffset(
|
||||||
muzzleFlash,
|
muzzleFlash,
|
||||||
() => Util.GetTurretPosition(self, unit, attackInfo.PrimaryOffset, attack.primaryRecoil),
|
() => Util.GetTurretPosition(self, unit, attackInfo.PrimaryOffset, attack.primaryRecoil),
|
||||||
|
|||||||
@@ -150,22 +150,22 @@
|
|||||||
</unit>
|
</unit>
|
||||||
<!-- allied gun turret -->
|
<!-- allied gun turret -->
|
||||||
<unit name="gun">
|
<unit name="gun">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="recoil" start="32" length="32" />
|
<sequence name="recoil" start="32" facings="32" />
|
||||||
<sequence name="make" start="0" length="20" src="gunmake" />
|
<sequence name="make" start="0" length="20" src="gunmake" />
|
||||||
<sequence name="damaged-idle" start="64" length="32" />
|
<sequence name="damaged-idle" start="64" length="32" />
|
||||||
<sequence name="damaged-recoil" start="96" length="32" />
|
<sequence name="damaged-recoil" start="96" length="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- AA gun -->
|
<!-- AA gun -->
|
||||||
<unit name="agun">
|
<unit name="agun">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="damaged-idle" start="32" length="32" />
|
<sequence name="damaged-idle" start="32" facings="32" />
|
||||||
<sequence name="make" start="0" length="*" src="agunmake" />
|
<sequence name="make" start="0" length="*" src="agunmake" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- sam site -->
|
<!-- sam site -->
|
||||||
<unit name="sam">
|
<unit name="sam">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="damaged-idle" start="34" length="32" />
|
<sequence name="damaged-idle" start="34" facings="32" />
|
||||||
<sequence name="make" start="0" length="*" src="sammake" />
|
<sequence name="make" start="0" length="*" src="sammake" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- flame turret -->
|
<!-- flame turret -->
|
||||||
@@ -226,80 +226,80 @@
|
|||||||
</unit>
|
</unit>
|
||||||
<!-- mcv -->
|
<!-- mcv -->
|
||||||
<unit name="mcv">
|
<unit name="mcv">
|
||||||
<sequence name="idle" start="0" length="*" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- truck -->
|
<!-- truck -->
|
||||||
<unit name="truk">
|
<unit name="truk">
|
||||||
<sequence name="idle" start="0" length="*" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- harv -->
|
<!-- harv -->
|
||||||
<unit name="harv">
|
<unit name="harv">
|
||||||
<sequence name="idle" start="0" length="1" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="harvest" start="32" length="8" facings="8" />
|
<sequence name="harvest" start="32" length="8" facings="8" />
|
||||||
<sequence name="empty" start="96" length="15" />
|
<sequence name="empty" start="96" length="15" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- light tank -->
|
<!-- light tank -->
|
||||||
<unit name="1tnk">
|
<unit name="1tnk">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="turret" start="32" length="32" />
|
<sequence name="turret" start="32" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- medium tank -->
|
<!-- medium tank -->
|
||||||
<unit name="2tnk">
|
<unit name="2tnk">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="turret" start="32" length="32" />
|
<sequence name="turret" start="32" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- heavy tank -->
|
<!-- heavy tank -->
|
||||||
<unit name="3tnk">
|
<unit name="3tnk">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="turret" start="32" length="32" />
|
<sequence name="turret" start="32" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- mammoth tank -->
|
<!-- mammoth tank -->
|
||||||
<unit name="4tnk">
|
<unit name="4tnk">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="turret" start="32" length="32" />
|
<sequence name="turret" start="32" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- v2 rocket launcher -->
|
<!-- v2 rocket launcher -->
|
||||||
<unit name="v2rl">
|
<unit name="v2rl">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="empty-idle" start="32" length="32" />
|
<sequence name="empty-idle" start="32" facings="32" />
|
||||||
<sequence name="aim" start="64" length="8" />
|
<sequence name="aim" start="64" facings="8" />
|
||||||
<sequence name="empty-aim" start="72" length="8" />
|
<sequence name="empty-aim" start="72" facings="8" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- artillery -->
|
<!-- artillery -->
|
||||||
<unit name="arty">
|
<unit name="arty">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- jeep -->
|
<!-- jeep -->
|
||||||
<unit name="jeep">
|
<unit name="jeep">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="turret" start="32" length="32" />
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<sequence name="muzzle" start="0" length="48" src="minigun" />
|
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- apc -->
|
<!-- apc -->
|
||||||
<unit name="apc">
|
<unit name="apc">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="muzzle" start="0" length="48" src="minigun" />
|
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||||
<sequence name="close" start="32" length="3" />
|
<sequence name="close" start="32" length="3" />
|
||||||
<sequence name="unload" start="32" length="1" />
|
<sequence name="unload" start="32" length="1" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- mine layer -->
|
<!-- mine layer -->
|
||||||
<unit name="mnly">
|
<unit name="mnly">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<!-- and 16 "lay mine" sprites, not used in real-ra -->
|
<!-- and 16 "lay mine" sprites, not used in real-ra -->
|
||||||
</unit>
|
</unit>
|
||||||
<!-- radar jammer -->
|
<!-- radar jammer -->
|
||||||
<unit name="mrj">
|
<unit name="mrj">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="spinner" start="32" length="32" />
|
<sequence name="spinner" start="32" length="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- mobile gap generator -->
|
<!-- mobile gap generator -->
|
||||||
<unit name="mgg">
|
<unit name="mgg">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="spinner" start="32" length="8" />
|
<sequence name="spinner" start="32" length="8" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- submarine -->
|
<!-- submarine -->
|
||||||
<unit name="ss">
|
<unit name="ss">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- rifle infantry -->
|
<!-- rifle infantry -->
|
||||||
<unit name="e1">
|
<unit name="e1">
|
||||||
@@ -401,16 +401,16 @@
|
|||||||
<sequence name="crawl" start="82" length="4" facings="8" />
|
<sequence name="crawl" start="82" length="4" facings="8" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="ca">
|
<unit name="ca">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
<sequence name="turret" start="0" length="32" src="turr" />
|
<sequence name="turret" start="0" facings="32" src="turr" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="dd">
|
<unit name="dd">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
<sequence name="turret" start="0" length="32" src="ssam" />
|
<sequence name="turret" start="0" facings="32" src="ssam" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="pt">
|
<unit name="pt">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
<sequence name="turret" start="0" length="32" src="mgun" />
|
<sequence name="turret" start="0" facings="32" src="mgun" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="medi">
|
<unit name="medi">
|
||||||
<sequence name="stand" start="0" length="8" />
|
<sequence name="stand" start="0" length="8" />
|
||||||
@@ -460,23 +460,23 @@
|
|||||||
<sequence name="tag-primary" start="2" length="1" />
|
<sequence name="tag-primary" start="2" length="1" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="mig">
|
<unit name="mig">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="yak">
|
<unit name="yak">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="heli">
|
<unit name="heli">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="hind">
|
<unit name="hind">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="tran">
|
<unit name="tran">
|
||||||
<sequence name="idle" start="0" length="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||||
<sequence name="rotor2" start="0" length="4" src="rrotor" />
|
<sequence name="rotor2" start="0" length="4" src="rrotor" />
|
||||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||||
@@ -841,6 +841,6 @@
|
|||||||
<sequence name="idle" start="5" length="11" />
|
<sequence name="idle" start="5" length="11" />
|
||||||
</unit>
|
</unit>
|
||||||
<unit name="badr">
|
<unit name="badr">
|
||||||
<sequence name="idle" start="0" length="16" />
|
<sequence name="idle" start="0" facings="16" />
|
||||||
</unit>
|
</unit>
|
||||||
</sequences>
|
</sequences>
|
||||||
|
|||||||
Reference in New Issue
Block a user