Don't show make animations for starting actors.

This commit is contained in:
Paul Chote
2013-12-04 10:23:05 +13:00
parent 14df1ac6df
commit 19ddb61d18
2 changed files with 11 additions and 8 deletions

View File

@@ -19,23 +19,25 @@ namespace OpenRA.Mods.RA.Render
[Desc("Sequence name to use")]
public readonly string Sequence = "crumble-overlay";
public object Create(ActorInitializer init) { return new WithCrumbleOverlay(init.self, this); }
public object Create(ActorInitializer init) { return new WithCrumbleOverlay(init, this); }
}
public class WithCrumbleOverlay : INotifyBuildComplete
{
Animation overlay;
bool buildComplete = false;
public WithCrumbleOverlay(Actor self, WithCrumbleOverlayInfo info)
public WithCrumbleOverlay(ActorInitializer init, WithCrumbleOverlayInfo info)
{
var rs = self.Trait<RenderSprites>();
var rs = init.self.Trait<RenderSprites>();
overlay = new Animation(rs.GetImage(self));
if (!init.Contains<SkipMakeAnimsInit>())
{
var overlay = new Animation(rs.GetImage(init.self));
overlay.PlayThen(info.Sequence, () => buildComplete = false);
rs.anims.Add("make_overlay_{0}".F(info.Sequence),
new AnimationWithOffset(overlay, null, () => !buildComplete, null));
}
}
public void BuildingComplete(Actor self)
{

View File

@@ -45,6 +45,7 @@ namespace OpenRA.Mods.RA
{
new LocationInit(sp),
new OwnerInit(p),
new SkipMakeAnimsInit(),
});
}