Allow skipping make anim for actors with WithMakeAnimation and GrantConditionOnDeploy

This commit is contained in:
reaperrr
2017-08-17 14:54:08 +02:00
committed by Paul Chote
parent f3f2621eeb
commit cab6a96b16
3 changed files with 27 additions and 8 deletions

View File

@@ -55,6 +55,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Can this actor undeploy?")]
public readonly bool CanUndeploy = true;
[Desc("Skip make/deploy animation?")]
public readonly bool SkipMakeAnimation = false;
public object Create(ActorInitializer init) { return new GrantConditionOnDeploy(init, this); }
}
@@ -223,7 +226,7 @@ namespace OpenRA.Mods.Common.Traits
OnDeployCompleted();
else
foreach (var n in notify)
n.Deploy(self);
n.Deploy(self, Info.SkipMakeAnimation);
}
/// <summary>Play undeploy sound and animation and after that revoke the condition.</summary>
@@ -246,7 +249,7 @@ namespace OpenRA.Mods.Common.Traits
OnUndeployCompleted();
else
foreach (var n in notify)
n.Undeploy(self);
n.Undeploy(self, Info.SkipMakeAnimation);
}
void OnDeployStarted()