From bc3d1ccb6d0ccf26656d24aa407988df1195b55e Mon Sep 17 00:00:00 2001 From: 2hwk <15316958+2hwk@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:43:21 +0800 Subject: [PATCH] fix(a380/nd): fix first officer's ND cursor (#9096) * fix: FO ND mouse cursor * fix: remove dead code --------- Co-authored-by: flogross89 <63071941+flogross89@users.noreply.github.com> --- .../instruments/src/MFD/pages/common/MouseCursor.tsx | 10 +++------- .../src/systems/instruments/src/PFD/instrument.tsx | 10 ---------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/fbw-a380x/src/systems/instruments/src/MFD/pages/common/MouseCursor.tsx b/fbw-a380x/src/systems/instruments/src/MFD/pages/common/MouseCursor.tsx index 5323c361196..76e586c8702 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/pages/common/MouseCursor.tsx +++ b/fbw-a380x/src/systems/instruments/src/MFD/pages/common/MouseCursor.tsx @@ -29,13 +29,9 @@ export class MouseCursor extends DisplayComponent { this.divRef.instance.style.display = 'block'; } - if (this.props.side.get() === 'CAPT') { - this.divRef.instance.style.left = `${x - 40}px`; - this.divRef.instance.style.top = `${y - 40}px`; - } else if (this.props.side.get() === 'FO' && this.props.isDoubleScreenMfd) { - this.divRef.instance.style.left = `${x - 40 - 878}px`; // Workaround for double screen, remove when rpc sync implemented - this.divRef.instance.style.top = `${y - 40}px`; - } + const xOffset = this.props.side.get() === 'FO' && this.props.isDoubleScreenMfd ? x - 40 - 878 : x - 40; + this.divRef.instance.style.left = `${xOffset}px`; + this.divRef.instance.style.top = `${y - 40}px`; if (this.hideTimer) { clearTimeout(this.hideTimer); diff --git a/fbw-a380x/src/systems/instruments/src/PFD/instrument.tsx b/fbw-a380x/src/systems/instruments/src/PFD/instrument.tsx index 45a03ae9985..2cbf739710b 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/instrument.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/instrument.tsx @@ -91,16 +91,6 @@ class A380X_PFD extends BaseInstrument { this.backplane.onUpdate(); } - - // FIXME remove. This does not belong in the PFD, and in any case we should use GameStateProvider as it has workarounds for issues with onFlightStart - protected onFlightStart() { - super.onFlightStart(); - if (SimVar.GetSimVarValue('L:A32NX_IS_READY', 'number') !== 1) { - // set ready signal that JS code is initialized and flight is actually started - // -> user pressed 'READY TO FLY' button - SimVar.SetSimVarValue('L:A32NX_IS_READY', 'number', 1); - } - } } registerInstrument('a380x-pfd', A380X_PFD);