Add order voice to GrantConditionOnDeploy.

This commit is contained in:
tovl
2019-04-21 21:12:53 +02:00
committed by reaperrr
parent 9419d1b924
commit 8e91a1ba89
5 changed files with 13 additions and 2 deletions

View File

@@ -54,13 +54,15 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Skip make/deploy animation?")]
public readonly bool SkipMakeAnimation = false;
[VoiceReference] public readonly string Voice = "Action";
public override object Create(ActorInitializer init) { return new GrantConditionOnDeploy(init, this); }
}
public enum DeployState { Undeployed, Deploying, Deployed, Undeploying }
public class GrantConditionOnDeploy : PausableConditionalTrait<GrantConditionOnDeployInfo>, IResolveOrder, IIssueOrder, INotifyCreated,
INotifyDeployComplete, IIssueDeployOrder
INotifyDeployComplete, IIssueDeployOrder, IOrderVoice
{
readonly Actor self;
readonly bool checkTerrainType;
@@ -157,6 +159,11 @@ namespace OpenRA.Mods.Common.Traits
self.QueueActivity(new DeployForGrantedCondition(self, this));
}
public string VoicePhraseForOrder(Actor self, Order order)
{
return order.OrderString == "GrantConditionOnDeploy" ? Info.Voice : null;
}
bool IsCursorBlocked()
{
if (IsTraitPaused)

View File

@@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Traits
public string VoicePhraseForOrder(Actor self, Order order)
{
return (order.OrderString == "DeployTransform") ? Info.Voice : null;
return order.OrderString == "DeployTransform" ? Info.Voice : null;
}
public bool CanDeploy()