Skip to content

Commit

Permalink
fix(a380/nd): fix first officer's ND cursor (#9096)
Browse files Browse the repository at this point in the history
* fix: FO ND mouse cursor

* fix: remove dead code

---------

Co-authored-by: flogross89 <[email protected]>
(cherry picked from commit bc3d1cc)
  • Loading branch information
2hwk authored and flogross89 committed Oct 22, 2024
1 parent e58955f commit e7a8cbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ export class MouseCursor extends DisplayComponent<MouseCursorProps> {
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);
Expand Down
10 changes: 0 additions & 10 deletions fbw-a380x/src/systems/instruments/src/PFD/instrument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit e7a8cbd

Please sign in to comment.