Skip to content

Commit

Permalink
fix(a380x): add missing telex check (#9190)
Browse files Browse the repository at this point in the history
* 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 <maximilian.a.reuter@gmail.com>
Co-authored-by: Benjamin Dupont <4503241+Benjozork@users.noreply.github.com>

(cherry picked from commit 63c511e)
  • Loading branch information
Saschl authored and Benjozork committed Nov 2, 2024
1 parent b6f47db commit d710c97
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions fbw-a380x/src/systems/extras-host/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -58,6 +59,8 @@ class ExtrasHost extends BaseInstrument {

private readonly pilotSeatManager = new PilotSeatManager(ExtrasHost.flightDeckBounds);

private readonly telexCheck = new TelexCheck();

/**
* "mainmenu" = 0
* "loading" = 1
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
}
}
}

0 comments on commit d710c97

Please sign in to comment.