Add SpeechNotifications for InsufficientPower and Launch on support powers
This commit is contained in:
@@ -127,10 +127,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound;
|
||||
Game.Sound.Play(notification);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||
Info.IncomingSpeechNotification, self.Owner.Faction.InternalName);
|
||||
var isAllied = self.Owner.IsAlliedWith(self.World.RenderPlayer);
|
||||
Game.Sound.Play(isAllied ? Info.LaunchSound : Info.IncomingSound);
|
||||
|
||||
var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification;
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", speech, self.Owner.Faction.InternalName);
|
||||
|
||||
Actor distanceTestActor = null;
|
||||
for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++)
|
||||
|
||||
@@ -94,7 +94,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
base.Activate(self, order, manager);
|
||||
|
||||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
{
|
||||
Game.Sound.Play(Info.LaunchSound);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||
Info.LaunchSpeechNotification, self.Owner.Faction.InternalName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.Sound.Play(Info.IncomingSound);
|
||||
|
||||
@@ -38,7 +38,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string SelectTargetSound = null;
|
||||
public readonly string SelectTargetSpeechNotification = null;
|
||||
public readonly string InsufficientPowerSound = null;
|
||||
public readonly string InsufficientPowerSpeechNotification = null;
|
||||
public readonly string LaunchSound = null;
|
||||
public readonly string LaunchSpeechNotification = null;
|
||||
public readonly string IncomingSound = null;
|
||||
public readonly string IncomingSpeechNotification = null;
|
||||
|
||||
|
||||
@@ -114,7 +114,11 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
protected void ClickIcon(SupportPowerIcon clicked)
|
||||
{
|
||||
if (!clicked.Power.Active)
|
||||
{
|
||||
Game.Sound.PlayToPlayer(spm.Self.Owner, clicked.Power.Info.InsufficientPowerSound);
|
||||
Game.Sound.PlayNotification(spm.Self.World.Map.Rules, spm.Self.Owner, "Speech",
|
||||
clicked.Power.Info.InsufficientPowerSpeechNotification, spm.Self.Owner.Faction.InternalName);
|
||||
}
|
||||
else
|
||||
clicked.Power.Target();
|
||||
}
|
||||
|
||||
@@ -75,6 +75,8 @@ namespace OpenRA.Mods.RA.Traits
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
Game.Sound.PlayToPlayer(self.Owner, Info.LaunchSound);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||
Info.LaunchSpeechNotification, self.Owner.Faction.InternalName);
|
||||
|
||||
w.Add(new SatelliteLaunch(self, info));
|
||||
|
||||
|
||||
@@ -153,8 +153,11 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound;
|
||||
Game.Sound.Play(notification);
|
||||
var isAllied = self.Owner.IsAlliedWith(self.World.RenderPlayer);
|
||||
Game.Sound.Play(isAllied ? Info.LaunchSound : Info.IncomingSound);
|
||||
|
||||
var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification;
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", speech, self.Owner.Faction.InternalName);
|
||||
|
||||
Actor distanceTestActor = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user