From d710c97ad4fba7a1fedb65ff22be7ea8518eee51 Mon Sep 17 00:00:00 2001 From: Saschl <19493808+saschl@users.noreply.github.com> Date: Sat, 2 Nov 2024 00:14:18 -0400 Subject: [PATCH] fix(a380x): add missing telex check (#9190) * fix: add missing telex check for a380 * remove copy pasta * update header * adapt confusing naming * added var to track whether popup was shown + changelog --------- Co-authored-by: Maximilian Reuter Co-authored-by: Benjamin Dupont <4503241+Benjozork@users.noreply.github.com> (cherry picked from commit 63c511eb868ed03f216f274aefadecfd35711f59) --- .github/CHANGELOG.md | 3 ++- fbw-a380x/src/systems/extras-host/index.ts | 4 ++++ .../modules/telex_check/TelexCheck.ts | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 fbw-a380x/src/systems/extras-host/modules/telex_check/TelexCheck.ts diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index d0fdbc2fa3b..a3492ed630b 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -10,8 +10,9 @@ 1. [GENERAL] Fixed issue in C++ WASM Framework that caused performance degradation in some WASM modules - @frankkopp (Frank Kopp) 1. [A32NX/FCU] Fixed auto-initialisation of baro unit - @tracernz (Mike) 1. [A380X/FCU] Fix baro-preselect not recognising baro unit changes - @tracernz (Mike) -1. [A380X/EFB] Fixed doors automatically opening in flight - @saschl (saschl#9432) +1. [A380X/EFB] Fixed doors automatically opening in flight - @saschl (saschl) 1. [A380X/FMS] Fixed layouting issue on FMS/ACTIVE/PERF/T.O page for some users - @flogross89 (floridude) +1. [A380X/TELEX] Added popup for telex consent @saschl (saschl) @Maximilian-Reuter (\_chaoz) ## 0.12.0 diff --git a/fbw-a380x/src/systems/extras-host/index.ts b/fbw-a380x/src/systems/extras-host/index.ts index b64b69a02ce..2770141d6d2 100644 --- a/fbw-a380x/src/systems/extras-host/index.ts +++ b/fbw-a380x/src/systems/extras-host/index.ts @@ -8,6 +8,7 @@ import { PushbuttonCheck } from 'extras-host/modules/pushbutton_check/Pushbutton import { KeyInterceptor } from './modules/key_interceptor/KeyInterceptor'; import { VersionCheck } from './modules/version_check/VersionCheck'; import { AircraftSync } from 'extras-host/modules/aircraft_sync/AircraftSync'; +import { TelexCheck } from 'extras-host/modules/telex_check/TelexCheck'; /** * This is the main class for the extras-host instrument. @@ -58,6 +59,8 @@ class ExtrasHost extends BaseInstrument { private readonly pilotSeatManager = new PilotSeatManager(ExtrasHost.flightDeckBounds); + private readonly telexCheck = new TelexCheck(); + /** * "mainmenu" = 0 * "loading" = 1 @@ -122,6 +125,7 @@ class ExtrasHost extends BaseInstrument { this.keyInterceptor.startPublish(); this.simVarPublisher.startPublish(); this.aircraftSync.startPublish(); + this.telexCheck.showPopup(); // Signal that the aircraft is ready via L:A32NX_IS_READY SimVar.SetSimVarValue('L:A32NX_IS_READY', 'number', 1); diff --git a/fbw-a380x/src/systems/extras-host/modules/telex_check/TelexCheck.ts b/fbw-a380x/src/systems/extras-host/modules/telex_check/TelexCheck.ts new file mode 100644 index 00000000000..bf695f13807 --- /dev/null +++ b/fbw-a380x/src/systems/extras-host/modules/telex_check/TelexCheck.ts @@ -0,0 +1,24 @@ +// If the consent is not set, show telex page + +// Copyright (c) 2024 FlyByWire Simulations +// SPDX-License-Identifier: GPL-3.0 + +import { NXDataStore, PopUpDialog } from '@flybywiresim/fbw-sdk'; + +export class TelexCheck { + public showPopup(): void { + const telexPopupState = NXDataStore.get('TELEX_POPUP_SHOWN', 'false'); + const popup = new PopUpDialog(); + + if (telexPopupState === 'false') { + popup.showPopUp( + 'TELEX CONFIGURATION', + 'You have not yet configured the telex option. Telex enables free text and live map. If enabled, aircraft position data is published for the duration of the flight. Messages are public and not moderated. USE AT YOUR OWN RISK. To learn more about telex and the features it enables, please go to https://docs.flybywiresim.com/telex. Would you like to enable telex?', + 'small', + () => NXDataStore.set('CONFIG_ONLINE_FEATURES_STATUS', 'ENABLED'), + () => NXDataStore.set('CONFIG_ONLINE_FEATURES_STATUS', 'DISABLED'), + ); + NXDataStore.set('TELEX_POPUP_SHOWN', 'true'); + } + } +}