From 555aa69a2ae2fdabbd97e0c68add9d725ab5279c Mon Sep 17 00:00:00 2001 From: Florian Gross <63071941+flogross89@users.noreply.github.com> Date: Tue, 21 Jan 2025 03:47:05 +0200 Subject: [PATCH] weird style import to override EFB styles in OIT + OFP page --- .../systems/instruments/src/OIT/style.scss | 8 ++++++ .../instruments/src/OIT/widget-style.scss | 4 ++- .../instruments/src/OITlegacy/Efb.scss | 8 ------ .../instruments/src/OITlegacy/OitLegacy.tsx | 25 +++++++++++++++++-- .../instruments/src/OITlegacy/index.scss | 3 --- 5 files changed, 34 insertions(+), 14 deletions(-) delete mode 100644 fbw-a380x/src/systems/instruments/src/OITlegacy/index.scss diff --git a/fbw-a380x/src/systems/instruments/src/OIT/style.scss b/fbw-a380x/src/systems/instruments/src/OIT/style.scss index 0cdcd479d3f..fc689940b39 100644 --- a/fbw-a380x/src/systems/instruments/src/OIT/style.scss +++ b/fbw-a380x/src/systems/instruments/src/OIT/style.scss @@ -172,3 +172,11 @@ align-items: center; flex-direction: row; } + +$font-file-path: '/Fonts/fbw-a380x/EFB'; + +@import "../../../../../../fbw-common/src/systems/instruments/src/EFB/Assets/Efb.scss"; + +.nopointer { + pointer-events: none; +} diff --git a/fbw-a380x/src/systems/instruments/src/OIT/widget-style.scss b/fbw-a380x/src/systems/instruments/src/OIT/widget-style.scss index ab0d20f397b..2a7b36d8e6d 100644 --- a/fbw-a380x/src/systems/instruments/src/OIT/widget-style.scss +++ b/fbw-a380x/src/systems/instruments/src/OIT/widget-style.scss @@ -91,7 +91,9 @@ } .mfd-button.disabled { - color: $display-dark-grey; + color: $display-dark-grey !important; + --color-text: $display-dark-grey; + color: var(--color-text); } .mfd-button.selected { diff --git a/fbw-a380x/src/systems/instruments/src/OITlegacy/Efb.scss b/fbw-a380x/src/systems/instruments/src/OITlegacy/Efb.scss index 7eba995af69..2242d35cf30 100644 --- a/fbw-a380x/src/systems/instruments/src/OITlegacy/Efb.scss +++ b/fbw-a380x/src/systems/instruments/src/OITlegacy/Efb.scss @@ -1,10 +1,2 @@ // Copyright (c) 2023-2024 FlyByWire Simulations // SPDX-License-Identifier: GPL-3.0 - -$font-file-path: '/Fonts/fbw-a380x/EFB'; - -@import "../../../../../../fbw-common/src/systems/instruments/src/EFB/Assets/Efb.scss"; - -.nopointer { - pointer-events: none; -} diff --git a/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx b/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx index 8d90fa598c1..f8eff1cf166 100644 --- a/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx +++ b/fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx @@ -10,6 +10,9 @@ import { ModalProvider, PowerContext, PowerStates, + setAirframeInfo, + setCabinInfo, + setFlypadInfo, store, } from '@flybywiresim/flypad'; @@ -21,7 +24,8 @@ import { Provider } from 'react-redux'; import { TroubleshootingContextProvider } from '../../../../../../fbw-common/src/systems/instruments/src/EFB/TroubleshootingContext'; import { ErrorBoundary } from 'react-error-boundary'; import { MemoryRouter as Router } from 'react-router'; -import { useSimVar } from '@flybywiresim/fbw-sdk'; +import { UniversalConfigProvider, useSimVar } from '@flybywiresim/fbw-sdk'; +import { Dispatch } from '../../../../../../fbw-common/src/systems/instruments/src/EFB/Dispatch/Dispatch'; export const getDisplayIndex = () => { const url = Array.from(document.querySelectorAll('vcockpit-panel > *')) @@ -46,6 +50,20 @@ export const OitEfbWrapper: React.FC = ({ eventBus }) => { const [err, setErr] = useState(false); + useEffect(() => { + UniversalConfigProvider.fetchAirframeInfo(process.env.AIRCRAFT_PROJECT_PREFIX, process.env.AIRCRAFT_VARIANT).then( + (info) => store.dispatch(setAirframeInfo(info)), + ); + + UniversalConfigProvider.fetchFlypadInfo(process.env.AIRCRAFT_PROJECT_PREFIX, process.env.AIRCRAFT_VARIANT).then( + (info) => store.dispatch(setFlypadInfo(info)), + ); + + UniversalConfigProvider.fetchCabinInfo(process.env.AIRCRAFT_PROJECT_PREFIX, process.env.AIRCRAFT_VARIANT).then( + (info) => store.dispatch(setCabinInfo(info)), + ); + }, []); + useEffect(() => { document .getElementsByTagName('a380x-oitlegacy')[0] @@ -126,7 +144,10 @@ export const OitEfbWrapper: React.FC = ({ eventBus }) => { }} >
-
{showCharts === 1 && }
+
+ {showCharts === 1 && } + {showOfp === 1 && } +
)} diff --git a/fbw-a380x/src/systems/instruments/src/OITlegacy/index.scss b/fbw-a380x/src/systems/instruments/src/OITlegacy/index.scss deleted file mode 100644 index 6f83e3816b4..00000000000 --- a/fbw-a380x/src/systems/instruments/src/OITlegacy/index.scss +++ /dev/null @@ -1,3 +0,0 @@ -text { - font-family: "Helvetica"; -}