Skip to content

Commit

Permalink
weird style import to override EFB styles in OIT + OFP page
Browse files Browse the repository at this point in the history
  • Loading branch information
flogross89 committed Jan 21, 2025
1 parent 6579f63 commit 555aa69
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 14 deletions.
8 changes: 8 additions & 0 deletions fbw-a380x/src/systems/instruments/src/OIT/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
4 changes: 3 additions & 1 deletion fbw-a380x/src/systems/instruments/src/OIT/widget-style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 0 additions & 8 deletions fbw-a380x/src/systems/instruments/src/OITlegacy/Efb.scss
Original file line number Diff line number Diff line change
@@ -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;
}
25 changes: 23 additions & 2 deletions fbw-a380x/src/systems/instruments/src/OITlegacy/OitLegacy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import {
ModalProvider,
PowerContext,
PowerStates,
setAirframeInfo,
setCabinInfo,
setFlypadInfo,
store,
} from '@flybywiresim/flypad';

Expand All @@ -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 > *'))
Expand All @@ -46,6 +50,20 @@ export const OitEfbWrapper: React.FC<OitEfbWrapperProps> = ({ 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]
Expand Down Expand Up @@ -126,7 +144,10 @@ export const OitEfbWrapper: React.FC<OitEfbWrapperProps> = ({ eventBus }) => {
}}
>
<div className="flex flex-row">
<div className="h-screen w-screen p-2.5 pt-0">{showCharts === 1 && <Navigation />}</div>
<div className="h-screen w-screen p-2.5 pt-0">
{showCharts === 1 && <Navigation />}
{showOfp === 1 && <Dispatch />}
</div>
</div>
</div>
)}
Expand Down
3 changes: 0 additions & 3 deletions fbw-a380x/src/systems/instruments/src/OITlegacy/index.scss

This file was deleted.

0 comments on commit 555aa69

Please sign in to comment.