From d5fd734c1b640a573f62d17e4f0a36f385a3f527 Mon Sep 17 00:00:00 2001 From: 747-4EVER <71572892+747-4EVER@users.noreply.github.com> Date: Sat, 16 Apr 2022 12:19:37 +0100 Subject: [PATCH] feat(Sounds) Added C-Chord and Caution Sounds (#431) * feat(MCP): Cosmetic Update * fix(AP) Fixed TO/GA keybind bug * fix(AP): LOC Fix * Fix(AP): LOC intercept * Squashed commit of the following: commit 8794e93f9e1b24775b8da43cf8c0faba2c462f22 Author: Ninjo Date: Fri Apr 15 14:35:15 2022 +0200 feat(sound): cchord and caution sounds (#429) commit e417aeda3ff04e5a25d1688929e4a172bbb13d5b Author: Ninjo Date: Thu Apr 14 23:53:44 2022 +0200 build: upload fragmenter zip assets to release (#428) commit 9f3a1361da9b8b4239824879590919678abe7c1a Author: Ninjo Date: Thu Apr 14 22:19:18 2022 +0200 build: fragmenter script (#427) commit d83c883caa80198c093a32bae488d0c9d062b807 Author: 747-4EVER <71572892+747-4EVER@users.noreply.github.com> Date: Thu Apr 14 11:18:48 2022 +0200 feat(EICAS) New Messages (#424) commit 942cb6258cafc15828a7df8c0cb69eff08aa8681 Author: dcherrie Date: Tue Apr 12 03:32:09 2022 +1000 feat: update salty livery model, new thumbnails (#420) commit 366bbc57c65f261bd6b85e67d45cf63bd3c6d9d3 Author: Robin Breitfeld Date: Sun Apr 10 22:10:49 2022 +0200 feat(fmc): VNAV operating altitude suggestion (#419) * VNAV climb altitude suggestion * remove unnecessary variable * update NaN check * update max crz altitude formula * fix(FMC): Fixed VNAV NaN bug * fix(FMC): better aligned text Co-authored-by: 747-4EVER <71572892+747-4EVER@users.noreply.github.com> commit 63347e49c56a1d3dac73c453ffc37b2178ab0794 Author: Ninjo Date: Sun Apr 10 22:01:59 2022 +0200 feat(fmc): improvements to simbrief uplink (#422) * feat(fmc): no wpt select on uplink, uplink chime, fixes * chore: remove debug stuff and stuff * fix: crz alt format on perf init uplink preview * feat(Sounds): Added C-Chord and Caution Sound --- .../Airplanes/Salty_B747_8i/panel/panel.xml | 2 +- .../NavSystems/Shared/Salty_NavSystem.js | 34 ++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/salty-747/SimObjects/Airplanes/Salty_B747_8i/panel/panel.xml b/salty-747/SimObjects/Airplanes/Salty_B747_8i/panel/panel.xml index c6c66d7fe..95799305b 100644 --- a/salty-747/SimObjects/Airplanes/Salty_B747_8i/panel/panel.xml +++ b/salty-747/SimObjects/Airplanes/Salty_B747_8i/panel/panel.xml @@ -895,7 +895,7 @@ SoundOnly - tone_altitude_alert_default + cchord diff --git a/salty-747/html_ui/Pages/VCockpit/Instruments/NavSystems/Shared/Salty_NavSystem.js b/salty-747/html_ui/Pages/VCockpit/Instruments/NavSystems/Shared/Salty_NavSystem.js index 12dec3697..57b75023b 100644 --- a/salty-747/html_ui/Pages/VCockpit/Instruments/NavSystems/Shared/Salty_NavSystem.js +++ b/salty-747/html_ui/Pages/VCockpit/Instruments/NavSystems/Shared/Salty_NavSystem.js @@ -2235,8 +2235,8 @@ class Cabin_Annunciations extends Annunciations { this.displayCaution = []; this.displayAdvisory = []; this.displayMemo = []; - this.warningToneNameZ = new Name_Z("tone_warning"); - this.cautionToneNameZ = new Name_Z("tone_caution"); + this.warningToneNameZ = new Name_Z("siren"); + this.cautionToneNameZ = new Name_Z("caution_aural"); this.warningTone = false; this.firstAcknowledge = true; this.offStart = false; @@ -2245,6 +2245,7 @@ class Cabin_Annunciations extends Annunciations { super.init(root); this.alwaysUpdate = true; this.isPlayingWarningTone = false; + this.isPlayingCautionTone = false; for (var i = 0; i < this.allMessages.length; i++) { var message = this.allMessages[i]; var value = false; @@ -2292,10 +2293,24 @@ class Cabin_Annunciations extends Annunciations { break; case Annunciation_MessageType.CAUTION: this.displayCaution.push(message); - if (!message.Acknowledged && !this.isPlayingWarningTone && this.gps.isPrimary) { - let res = this.gps.playInstrumentSound("tone_caution"); - if (res) - this.isPlayingWarningTone = true; + + //Caution sound inhibited when fuel switches off and on ground or for ENG X SHUTDOWN message. + let shutdownInhibit = false; + let fuelSwitches = 0; + for (let i = 5; i < 9; i++) { + if (SimVar.GetSimVarValue("FUELSYSTEM VALVE SWITCH:" + i, "bool")) { + fuelSwitches++; + } + } + if ((fuelSwitches == 0 && Simplane.getIsGrounded()) || message.Text.indexOf('SHUTDOWN') !== -1) { + shutdownInhibit = true; + } + + if (!message.Acknowledged && !this.isPlayingCautionTone && this.gps.isPrimary && !shutdownInhibit) { + let res = this.gps.playInstrumentSound("caution_aural"); + if (res) { + this.isPlayingCautionTone = true; + } } break; case Annunciation_MessageType.ADVISORY: @@ -2381,7 +2396,7 @@ class Cabin_Annunciations extends Annunciations { this.needReload = false; } if (this.warningTone && !this.isPlayingWarningTone && this.gps.isPrimary) { - let res = this.gps.playInstrumentSound("tone_warning"); + let res = this.gps.playInstrumentSound("siren"); if (res) this.isPlayingWarningTone = true; } @@ -2412,9 +2427,12 @@ class Cabin_Annunciations extends Annunciations { } } onSoundEnd(_eventId) { - if (Name_Z.compare(_eventId, this.warningToneNameZ) || Name_Z.compare(_eventId, this.cautionToneNameZ)) { + if (Name_Z.compare(_eventId, this.warningToneNameZ)) { this.isPlayingWarningTone = false; } + else if (Name_Z.compare(_eventId, this.cautionToneNameZ)) { + this.isPlayingCautionTone = false; + } } onShutDown() { for (let i = 0; i < this.allMessages.length; i++) {