document the various overlay and animation change traits
This commit is contained in:
@@ -13,8 +13,12 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
[Desc("Renders a flame sprite on top of the actor.")]
|
||||
class WithFireInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
public readonly string StartSequence = "fire-start";
|
||||
public readonly string LoopSequence = "fire-loop";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithFire(init.self, this); }
|
||||
}
|
||||
|
||||
@@ -23,9 +27,9 @@ namespace OpenRA.Mods.Cnc
|
||||
public WithFire(Actor self, WithFireInfo info)
|
||||
{
|
||||
var rs = self.Trait<RenderSprites>();
|
||||
var roof = new Animation(self.World, rs.GetImage(self));
|
||||
roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
|
||||
rs.Add("fire", new AnimationWithOffset(roof, null, null, 1024));
|
||||
var fire = new Animation(self.World, rs.GetImage(self));
|
||||
fire.PlayThen(info.StartSequence, () => fire.PlayRepeating(info.LoopSequence));
|
||||
rs.Add("fire", new AnimationWithOffset(fire, null, null, 1024));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user