-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <maximilian.a.reuter@gmail.com> Co-authored-by: Benjamin Dupont <4503241+Benjozork@users.noreply.github.com> (cherry picked from commit 63c511e)
- Loading branch information
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
fbw-a380x/src/systems/extras-host/modules/telex_check/TelexCheck.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} | ||
} |