diff --git a/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs b/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs index ab325a4100..61b6f1dd14 100644 --- a/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs +++ b/OpenRA.Mods.Common/Traits/World/StartGameNotification.cs @@ -19,10 +19,16 @@ namespace OpenRA.Mods.Common.Traits [NotificationReference("Speech")] public readonly string Notification = "StartGame"; + [NotificationReference("Speech")] + public readonly string LoadedNotification = "GameLoaded"; + + [NotificationReference("Speech")] + public readonly string SavedNotification = "GameSaved"; + public object Create(ActorInitializer init) { return new StartGameNotification(this); } } - class StartGameNotification : IWorldLoaded + class StartGameNotification : IWorldLoaded, INotifyGameLoaded, INotifyGameSaved { StartGameNotificationInfo info; public StartGameNotification(StartGameNotificationInfo info) @@ -35,5 +41,17 @@ namespace OpenRA.Mods.Common.Traits if (!world.IsLoadingGameSave) Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName); } + + void INotifyGameLoaded.GameLoaded(World world) + { + if (!world.IsReplay) + Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.LoadedNotification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName); + } + + void INotifyGameSaved.GameSaved(World world) + { + if (!world.IsReplay) + Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.SavedNotification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName); + } } } diff --git a/mods/cnc/audio/notifications.yaml b/mods/cnc/audio/notifications.yaml index 5a75b7e364..3e6198540a 100644 --- a/mods/cnc/audio/notifications.yaml +++ b/mods/cnc/audio/notifications.yaml @@ -39,7 +39,9 @@ Speech: Repairing: repair1 SelectTarget: select1 SilosNeeded: silos1 - StartGame: + StartGame: + GameLoaded: + GameSaved: scold1 Training: bldging1 UnitDestroyed: dead1 UnitLost: unitlost diff --git a/mods/d2k/rules/world.yaml b/mods/d2k/rules/world.yaml index 34a5ca09df..c30b552ff6 100644 --- a/mods/d2k/rules/world.yaml +++ b/mods/d2k/rules/world.yaml @@ -233,6 +233,7 @@ World: PanelName: SKIRMISH_STATS LoadWidgetAtGameStart: ScriptTriggers: + StartGameNotification: EditorWorld: Inherits: ^BaseWorld diff --git a/mods/ra/audio/notifications.yaml b/mods/ra/audio/notifications.yaml index 090c09eb19..5577da435c 100644 --- a/mods/ra/audio/notifications.yaml +++ b/mods/ra/audio/notifications.yaml @@ -53,8 +53,6 @@ Speech: MercenaryRescued: mercr1 MissionAccomplished: misnwon1 MissionFailed: misnlst1 - MissionLoaded: load1 - MissionSaved: save1 MissionTimerInitialised: mtimein1 NavalUnitLost: navylst1 NewOptions: newopt1 @@ -85,6 +83,8 @@ Speech: SovietReinforcementsArrived: sovrein1 SpyPlaneReady: spypln1 StartGame: bctrinit + GameLoaded: load1 + GameSaved: save1 StructureDestroyed: strckil1 StructureSold: strusld1 TanyaFreed: tanyaf1 diff --git a/mods/ts/audio/speech-generic.yaml b/mods/ts/audio/speech-generic.yaml index b616dd172d..1db381e908 100644 --- a/mods/ts/audio/speech-generic.yaml +++ b/mods/ts/audio/speech-generic.yaml @@ -64,6 +64,8 @@ Speech: SpyKilledMissionFailed: 01-n284 SpyLostMissionFailed: 01-n210 StartGame: 00-i200 + GameLoaded: 00-i200 + GameSaved: StructureSold: 00-i228 SubterraneanUnitDetected: 00-i174 TertiaryObjectiveAchieved: 00-i104