mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(ui): show and hide the Cockpit surfaces from a store
The Cockpit controller publishes which surfaces are shown (the entry button and TR-3B chip, the HUD with its exit and reset buttons and briefing card, and the Contact card) and the views bind them. Focus moves to the exit button, and back to the entry, after Vue renders them. Layout scheduling counts the published presence as visible, so entry still lays out the cards. The Display portal restores only focus its move dropped. The Missions layer no longer hides the Contact card directly.
This commit is contained in:
1 parent
484243fe4b
commit
f279200af5
18 files changed
+422
-74
No files matched your search
@@ -38,6 +38,13 @@ export function publishContextView() {
|
||||
});
|
||||
}
|
||||
|
||||
/** Show or hide the Contact card; the HUD marks it with `context-active`. */
|
||||
export function showContextCard(visible) {
|
||||
if (this.presence.context === visible) return;
|
||||
this.presence.context = visible;
|
||||
this.publishPresenceView();
|
||||
}
|
||||
|
||||
export function updateContext(info, heading) {
|
||||
if (!this.context) return;
|
||||
const view = this.contextView;
|
||||
@@ -46,8 +53,7 @@ export function updateContext(info, heading) {
|
||||
const trackedId = info.icao24 || info.id;
|
||||
const readout = resolveCockpitContextReadout({ snapshot, info });
|
||||
if (!readout.visible) {
|
||||
this.context.hidden = true;
|
||||
this.hud?.classList.remove('context-active');
|
||||
this.showContextCard(false);
|
||||
this.contextLayoutStamp = null;
|
||||
this.pushCockpitSignal(
|
||||
'context-status',
|
||||
@@ -58,8 +64,7 @@ export function updateContext(info, heading) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.context.hidden = false;
|
||||
this.hud?.classList.add('context-active');
|
||||
this.showContextCard(true);
|
||||
const installationCoverage = snapshot.cohorts.find(
|
||||
(cohort) => cohort.id === 'military-installations',
|
||||
)?.coverage;
|
||||
|
||||
Reference in new issue
Block a user