diff --git a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs index 447458fb34..d8b37e51b4 100644 --- a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs @@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits Game.RunAfterDelay(info.NotificationDelay, () => { if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer) - Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName); + Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName); }); } @@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits Game.RunAfterDelay(info.NotificationDelay, () => { if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer) - Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName); + Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName); }); } diff --git a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs index 9bf02eaff9..8dc4f90669 100644 --- a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs +++ b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs @@ -48,6 +48,10 @@ namespace OpenRA.Mods.Common.Traits [Desc("Delay between the game over condition being met, and the game actually ending, in milliseconds.")] public readonly int GameOverDelay = 1500; + public readonly string WinNotification = null; + public readonly string LoseNotification = null; + public readonly string LeaveNotification = null; + public object Create(ActorInitializer init) { return new MissionObjectives(init.World, this); } } diff --git a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs index 0817e9b818..26306009b6 100644 --- a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs @@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits Game.RunAfterDelay(info.NotificationDelay, () => { if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer) - Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName); + Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName); }); } @@ -132,7 +132,7 @@ namespace OpenRA.Mods.Common.Traits Game.RunAfterDelay(info.NotificationDelay, () => { if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer) - Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName); + Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName); }); } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs index b882b0f99b..a5f1dbf978 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/IngameMenuLogic.cs @@ -44,7 +44,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic Action onQuit = () => { if (world.Type == WorldType.Regular) - Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", world.LocalPlayer == null ? null : world.LocalPlayer.Faction.InternalName); + { + var moi = world.Map.Rules.Actors["player"].TraitInfoOrDefault(); + if (moi != null) + { + var faction = world.LocalPlayer == null ? null : world.LocalPlayer.Faction.InternalName; + Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", moi.LeaveNotification, faction); + } + } leaving = true; diff --git a/mods/cnc/rules/player.yaml b/mods/cnc/rules/player.yaml index 62e7c97f45..58caf5843e 100644 --- a/mods/cnc/rules/player.yaml +++ b/mods/cnc/rules/player.yaml @@ -14,6 +14,9 @@ Player: SupportPowerManager: ScriptTriggers: MissionObjectives: + WinNotification: Win + LoseNotification: Lose + LeaveNotification: Leave ConquestVictoryConditions: PowerManager: SpeechNotification: LowPower diff --git a/mods/d2k/rules/player.yaml b/mods/d2k/rules/player.yaml index d6d286a793..0b373726be 100644 --- a/mods/d2k/rules/player.yaml +++ b/mods/d2k/rules/player.yaml @@ -81,6 +81,9 @@ Player: SupportPowerManager: ScriptTriggers: MissionObjectives: + WinNotification: Win + LoseNotification: Lose + LeaveNotification: Leave ConquestVictoryConditions: PowerManager: AdviceInterval: 650 diff --git a/mods/ra/rules/player.yaml b/mods/ra/rules/player.yaml index 76300bcb3e..c933f3f884 100644 --- a/mods/ra/rules/player.yaml +++ b/mods/ra/rules/player.yaml @@ -75,6 +75,9 @@ Player: SupportPowerManager: ScriptTriggers: MissionObjectives: + WinNotification: Win + LoseNotification: Lose + LeaveNotification: Leave ConquestVictoryConditions: PowerManager: SpeechNotification: LowPower diff --git a/mods/ts/rules/player.yaml b/mods/ts/rules/player.yaml index d3542fbf49..68fa8794f8 100644 --- a/mods/ts/rules/player.yaml +++ b/mods/ts/rules/player.yaml @@ -67,6 +67,9 @@ Player: SupportPowerManager: ScriptTriggers: MissionObjectives: + WinNotification: Win + LoseNotification: Lose + LeaveNotification: Leave ConquestVictoryConditions: PowerManager: SpeechNotification: LowPower