Add speech notification equivalents to support power sounds.

This commit is contained in:
Matthias Mailänder
2016-06-19 18:44:53 +02:00
parent 4c3ff461d4
commit 409fe9067a
3 changed files with 16 additions and 0 deletions

View File

@@ -129,6 +129,8 @@ namespace OpenRA.Mods.Common.Traits
{ {
var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound; var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound;
Game.Sound.Play(notification); Game.Sound.Play(notification);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.IncomingSpeechNotification, self.Owner.Faction.InternalName);
Actor distanceTestActor = null; Actor distanceTestActor = null;
for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++) for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++)

View File

@@ -96,7 +96,11 @@ namespace OpenRA.Mods.Common.Traits
if (self.Owner.IsAlliedWith(self.World.RenderPlayer)) if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
Game.Sound.Play(Info.LaunchSound); Game.Sound.Play(Info.LaunchSound);
else else
{
Game.Sound.Play(Info.IncomingSound); Game.Sound.Play(Info.IncomingSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.IncomingSpeechNotification, self.Owner.Faction.InternalName);
}
if (!string.IsNullOrEmpty(info.ActivationSequence)) if (!string.IsNullOrEmpty(info.ActivationSequence))
{ {

View File

@@ -32,11 +32,15 @@ namespace OpenRA.Mods.Common.Traits
public readonly string[] Prerequisites = { }; public readonly string[] Prerequisites = { };
public readonly string BeginChargeSound = null; public readonly string BeginChargeSound = null;
public readonly string BeginChargeSpeechNotification = null;
public readonly string EndChargeSound = null; public readonly string EndChargeSound = null;
public readonly string EndChargeSpeechNotification = null;
public readonly string SelectTargetSound = null; public readonly string SelectTargetSound = null;
public readonly string SelectTargetSpeechNotification = null;
public readonly string InsufficientPowerSound = null; public readonly string InsufficientPowerSound = null;
public readonly string LaunchSound = null; public readonly string LaunchSound = null;
public readonly string IncomingSound = null; public readonly string IncomingSound = null;
public readonly string IncomingSpeechNotification = null;
public readonly bool DisplayTimer = false; public readonly bool DisplayTimer = false;
@@ -83,16 +87,22 @@ namespace OpenRA.Mods.Common.Traits
public virtual void Charging(Actor self, string key) public virtual void Charging(Actor self, string key)
{ {
Game.Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound); Game.Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.BeginChargeSpeechNotification, self.Owner.Faction.InternalName);
} }
public virtual void Charged(Actor self, string key) public virtual void Charged(Actor self, string key)
{ {
Game.Sound.PlayToPlayer(self.Owner, Info.EndChargeSound); Game.Sound.PlayToPlayer(self.Owner, Info.EndChargeSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName);
} }
public virtual void SelectTarget(Actor self, string order, SupportPowerManager manager) public virtual void SelectTarget(Actor self, string order, SupportPowerManager manager)
{ {
Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound); Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.SelectTargetSpeechNotification, self.Owner.Faction.InternalName);
self.World.OrderGenerator = new SelectGenericPowerTarget(order, manager, info.Cursor, MouseButton.Left); self.World.OrderGenerator = new SelectGenericPowerTarget(order, manager, info.Cursor, MouseButton.Left);
} }