From 926ff90131c8c820729f9c21294bc02d8a4075ad Mon Sep 17 00:00:00 2001 From: Markus Korbel Date: Sat, 25 Dec 2021 01:51:04 +0000 Subject: [PATCH] Fixed pre-build file overwrite Removed testing workaround for missing 0 in female sound pack Added flight number announcement --- OpenSky.AgentMSFS/SpeechSoundPacks.cs | 2 +- .../Views/Models/NewFlightNotificationViewModel.cs | 8 ++++++++ OpenSky.AgentMSFS/pre-build.bat | 4 ++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OpenSky.AgentMSFS/SpeechSoundPacks.cs b/OpenSky.AgentMSFS/SpeechSoundPacks.cs index dffe974..fe97db3 100644 --- a/OpenSky.AgentMSFS/SpeechSoundPacks.cs +++ b/OpenSky.AgentMSFS/SpeechSoundPacks.cs @@ -127,7 +127,7 @@ private SpeechSoundPacks() if (packDictionary.ContainsKey(SpeechEvent.ReadyForBoardingBeginning) && packDictionary.ContainsKey(SpeechEvent.ReadyForBoardingEnd) && packDictionary.ContainsKey(SpeechEvent.Number1) && packDictionary.ContainsKey(SpeechEvent.Number2) && packDictionary.ContainsKey(SpeechEvent.Number3) && packDictionary.ContainsKey(SpeechEvent.Number4) && packDictionary.ContainsKey(SpeechEvent.Number5) && packDictionary.ContainsKey(SpeechEvent.Number6) && packDictionary.ContainsKey(SpeechEvent.Number7) && packDictionary.ContainsKey(SpeechEvent.Number8) && packDictionary.ContainsKey(SpeechEvent.Number9) && - packDictionary.ContainsKey(SpeechEvent.Number9)) // todo change last check back to 0! + packDictionary.ContainsKey(SpeechEvent.Number0)) { packDictionary.Add(SpeechEvent.ReadyForBoarding, null); } diff --git a/OpenSky.AgentMSFS/Views/Models/NewFlightNotificationViewModel.cs b/OpenSky.AgentMSFS/Views/Models/NewFlightNotificationViewModel.cs index 5b16bfb..dd02e6b 100644 --- a/OpenSky.AgentMSFS/Views/Models/NewFlightNotificationViewModel.cs +++ b/OpenSky.AgentMSFS/Views/Models/NewFlightNotificationViewModel.cs @@ -57,6 +57,14 @@ public NewFlightNotificationViewModel() var player = new SoundPlayer(assembly.GetManifestResourceStream("OpenSky.AgentMSFS.Resources.OSannouncement.wav")); player.Play(); + new Thread( + () => + { + Thread.Sleep(2000); + SpeechSoundPacks.Instance.PlaySpeechEvent(SpeechEvent.ReadyForBoarding, true, SimConnect.SimConnect.Instance.Flight?.FlightNumber.ToString()); + }) + { Name = "OpenSky.NewFlightNotificationViewModel.SpeechFlightNumber" }.Start(); + this.StartTrackingCommand = new Command(this.StartTracking); new Thread(this.NotificationTimeout) { Name = "OpenSky.NewFlightNotificationTimeout" }.Start(); } diff --git a/OpenSky.AgentMSFS/pre-build.bat b/OpenSky.AgentMSFS/pre-build.bat index 0af877a..c7fcf71 100644 --- a/OpenSky.AgentMSFS/pre-build.bat +++ b/OpenSky.AgentMSFS/pre-build.bat @@ -1,3 +1,3 @@ copy /Y "%1\app.config.%2" "%1\app.config" -xcopy "%1\..\SoundPacks\FemaleUS" "%1\bin\%2\SoundPacks\FemaleUS" /E /I -xcopy "%1\..\SoundPacks\MaleUK" "%1\bin\%2\SoundPacks\MaleUK" /E /I \ No newline at end of file +xcopy "%1\..\SoundPacks\FemaleUS" "%1\bin\%2\SoundPacks\FemaleUS" /E /I /Y +xcopy "%1\..\SoundPacks\MaleUK" "%1\bin\%2\SoundPacks\MaleUK" /E /I /Y \ No newline at end of file