Support for buildings without make animations
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#region Copyright & License Information
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
|
||||
* This file is part of OpenRA.
|
||||
@@ -48,7 +48,7 @@ namespace OpenRa.Traits.Activities
|
||||
{
|
||||
if( !started )
|
||||
{
|
||||
framesRemaining = self.traits.Get<RenderSimple>().anim.GetSequence( "make" ).Length;
|
||||
framesRemaining = (self.Info.Traits.Get<RenderBuildingInfo>().HasMakeAnimation) ? self.traits.Get<RenderSimple>().anim.GetSequence( "make" ).Length : 0;
|
||||
foreach( var ns in self.traits.WithInterface<INotifySold>() )
|
||||
ns.Selling( self );
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#region Copyright & License Information
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007,2009,2010 Chris Forbes, Robert Pepperell, Matthew Bowra-Dean, Paul Chote, Alli Witheford.
|
||||
* This file is part of OpenRA.
|
||||
@@ -25,6 +25,7 @@ namespace OpenRa.Traits
|
||||
{
|
||||
public class RenderBuildingInfo : RenderSimpleInfo
|
||||
{
|
||||
public readonly bool HasMakeAnimation = true;
|
||||
public override object Create(Actor self) { return new RenderBuilding(self);}
|
||||
}
|
||||
|
||||
@@ -39,8 +40,8 @@ namespace OpenRa.Traits
|
||||
|
||||
public RenderBuilding(Actor self, Func<int> baseFacing)
|
||||
: base(self, baseFacing)
|
||||
{
|
||||
if( Game.skipMakeAnims )
|
||||
{
|
||||
if( Game.skipMakeAnims || !self.Info.Traits.Get<RenderBuildingInfo>().HasMakeAnimation )
|
||||
Complete( self );
|
||||
else
|
||||
anim.PlayThen( "make", () => self.World.AddFrameEndTask( _ => Complete( self ) ) );
|
||||
@@ -124,7 +125,9 @@ namespace OpenRa.Traits
|
||||
|
||||
public void Selling( Actor self )
|
||||
{
|
||||
anim.PlayBackwardsThen( "make", null );
|
||||
if( !Game.skipMakeAnims && self.Info.Traits.Get<RenderBuildingInfo>().HasMakeAnimation )
|
||||
anim.PlayBackwardsThen( "make", null );
|
||||
|
||||
Sound.PlayToPlayer(self.Owner, "cashturn.aud");
|
||||
}
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
Wall:
|
||||
Selectable:
|
||||
RenderBuildingWall:
|
||||
HasMakeAnimation: false
|
||||
Palette: terrain
|
||||
DamageStates: 2
|
||||
|
||||
|
||||
@@ -864,32 +864,26 @@
|
||||
<sequence name="minor-damaged-idle" start="16" length="16" />
|
||||
<sequence name="damaged-idle" start="32" length="16" />
|
||||
<sequence name="critical-idle" start="48" length="16" />
|
||||
<sequence name="make" start="0" length="1" />
|
||||
</unit>
|
||||
<unit name="sbag">
|
||||
<sequence name="idle" start="0" length="16" />
|
||||
<sequence name="damaged-idle" start="16" length="16" />
|
||||
<sequence name="make" start="0" length="1" />
|
||||
</unit>
|
||||
<unit name="fenc">
|
||||
<sequence name="idle" start="0" length="16" />
|
||||
<sequence name="damaged-idle" start="16" length="16" />
|
||||
<sequence name="make" start="0" length="1" />
|
||||
</unit>
|
||||
<unit name="cycl">
|
||||
<sequence name="idle" start="0" length="16" />
|
||||
<sequence name="damaged-idle" start="16" length="16" />
|
||||
<sequence name="critical-idle" start="32" length="16" />
|
||||
<sequence name="make" start="0" length="1" />
|
||||
</unit>
|
||||
<unit name="barb">
|
||||
<sequence name="idle" start="0" length="16" />
|
||||
<sequence name="damaged-idle" start="16" length="16" />
|
||||
<sequence name="make" start="0" length="1" />
|
||||
</unit>
|
||||
<unit name="wood">
|
||||
<sequence name="idle" start="0" length="16" />
|
||||
<sequence name="damaged-idle" start="16" length="16" />
|
||||
<sequence name="make" start="0" length="1" />
|
||||
</unit>
|
||||
</sequences>
|
||||
Reference in New Issue
Block a user