Convert AnimationWithOffset to world coords.
Animations (via Actor.CenterPosition) now understand Altitude, so there is potential for mis-positioned animations if any existing altitude hacks were missed.
This commit is contained in:
@@ -15,17 +15,20 @@ namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
class WithFireInfo : ITraitInfo, Requires<RenderSimpleInfo>
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new WithFire(init.self); }
|
||||
public readonly WVec Offset = new WVec(299,-640,0);
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithFire(init.self, this); }
|
||||
}
|
||||
|
||||
class WithFire
|
||||
{
|
||||
public WithFire(Actor self)
|
||||
public WithFire(Actor self, WithFireInfo info)
|
||||
{
|
||||
var rs = self.Trait<RenderSimple>();
|
||||
var roof = new Animation(rs.GetImage(self));
|
||||
roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
|
||||
rs.anims.Add( "fire", new AnimationWithOffset( roof, wr => new float2(7,-15), null ) { ZOffset = 24 } );
|
||||
|
||||
rs.anims.Add("fire", new AnimationWithOffset(roof, () => info.Offset, null, 24));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user