don't display the overlay before the building is completed

This commit is contained in:
Matthias Mailänder
2013-08-13 17:00:59 +02:00
parent 004d3669c2
commit c0be16cde3

View File

@@ -25,9 +25,10 @@ namespace OpenRA.Mods.RA.Render
public object Create(ActorInitializer init) { return new WithIdleOverlay(init.self, this); }
}
public class WithIdleOverlay : INotifyDamageStateChanged
public class WithIdleOverlay : INotifyDamageStateChanged, INotifyBuildComplete
{
Animation overlay;
bool buildComplete;
public WithIdleOverlay(Actor self, WithIdleOverlayInfo info)
{
@@ -39,7 +40,12 @@ namespace OpenRA.Mods.RA.Render
rs.anims.Add("idle_overlay_{0}".F(info.Sequence),
new AnimationWithOffset(overlay,
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
null, p => WithTurret.ZOffsetFromCenter(self, p, 1)));
() => !buildComplete, p => WithTurret.ZOffsetFromCenter(self, p, 1)));
}
public void BuildingComplete(Actor self)
{
buildComplete = true;
}
public void DamageStateChanged(Actor self, AttackInfo e)