mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Make Space Missions an ordinary layer with its own panel
Space Missions no longer runs as a Context mode. The launches layer owns its Satellites dependency, including the rule that a Satellites off asked for after Space Missions was switched on ends it (request order decides), and a small controller connects the layer to its own panel and store. Context no longer isolates, snapshots or restores Space Missions or Satellites, so Contacts and Space Missions run together in either order, and scene playback no longer exits an isolating mode. Settled by the owner: Contacts leaves Satellites as it is, and only a person's or voice Satellites off ends Space Missions; a scene, story, preset or other programmatic off does not. Turning the layer on by hand or by voice, choosing it at first run, or picking a mission on the globe opens the Space Missions panel, and on a phone its Missions sheet. Asking voice to open the panel while the layer is off is refused with a reason, and voice never opens it while the Cockpit owns the screen. With no Context mode on, a voice Context off switches Space Missions off. A failed Satellites restore no longer cuts the layer's teardown short. Mission labels on the globe select their mission. The layer names a failed first index load itself, so the Context toast no longer imports Space Missions code. Also carries the satellites request ordering and DataLayerManager.waitForLayerIdle, the share token for the panel, voice panel ids, Cockpit folding the panel away and the phone tab ellipsis. The panel shares the rail gutters and hover border of the other side panels. On top of the Omnibar: "open space missions panel" reaches the new panel, and Open Context no longer answers to "missions". Co-authored-by: Sameh Khamis <[email protected]>
This commit is contained in:
1 parent
8b2ca602e5
commit
0a6fd5f43f
101 files changed
+2885
-1673
No files matched your search
@@ -138,6 +138,9 @@ const PANEL_ALIASES = new Map([
|
||||
['global context', 'global-context-panel'],
|
||||
['right context', 'global-context-panel'],
|
||||
['context right panel', 'global-context-panel'],
|
||||
['space missions panel', 'space-missions-panel'],
|
||||
['missions panel', 'space-missions-panel'],
|
||||
['mission panel', 'space-missions-panel'],
|
||||
['utilities', 'utilities-panel'],
|
||||
['utilities panel', 'utilities-panel'],
|
||||
['draw', 'utilities-panel'],
|
||||
@@ -167,6 +170,7 @@ const PANEL_IDS = new Set([
|
||||
'cctv-panel',
|
||||
'radio-panel',
|
||||
'global-context-panel',
|
||||
'space-missions-panel',
|
||||
'utilities-panel',
|
||||
'scene-panel',
|
||||
'pp-toggles',
|
||||
@@ -607,6 +611,12 @@ export function createGevActionRunner({
|
||||
changeOptions,
|
||||
);
|
||||
}
|
||||
if (layerId === 'satellites') {
|
||||
// A Satellites OFF can end Space Missions, which needs it.
|
||||
await dataManager.layers
|
||||
.get('rocket-launches')
|
||||
?.module?.waitForSatelliteIntents?.();
|
||||
}
|
||||
if (layerId === 'rocket-launches' || layerId === 'satellites') {
|
||||
await styleManager?._waitForContextLayerSettlement?.();
|
||||
}
|
||||
@@ -981,6 +991,27 @@ export function createGevActionRunner({
|
||||
...(!applied ? { error: say } : {}),
|
||||
};
|
||||
}
|
||||
// The Space Missions panel exists only while its layer is on; opening it
|
||||
// otherwise would fold the other right-rail panels for nothing.
|
||||
if (
|
||||
open &&
|
||||
panelId === 'space-missions-panel' &&
|
||||
!dataManager?.isEnabled?.('rocket-launches')
|
||||
) {
|
||||
const say = dataManager?.isEffectivelyEnabled?.('rocket-launches')
|
||||
? 'Space Missions is still starting; its panel opens when it is on.'
|
||||
: 'The Space Missions panel shows while Space Missions is on. Turn on Space Missions first.';
|
||||
return {
|
||||
ok: false,
|
||||
action: 'set_panel_open',
|
||||
panelId,
|
||||
open,
|
||||
applied: false,
|
||||
unavailable: true,
|
||||
say,
|
||||
error: say,
|
||||
};
|
||||
}
|
||||
if (!setPanelOpen(styleManager, panelId, open)) {
|
||||
const say = 'There is no panel to open here.';
|
||||
return {
|
||||
@@ -1030,6 +1061,47 @@ export function createGevActionRunner({
|
||||
...cancellationState(),
|
||||
};
|
||||
}
|
||||
if (mode === 'space-missions') {
|
||||
// Space Missions is an ordinary layer with its own panel, not a
|
||||
// Context mode; older phrasings still reach it through this alias.
|
||||
const result = await runGevAction(
|
||||
'set_layer_visibility',
|
||||
{ layerId: 'rocket-launches', enabled: true },
|
||||
runOptions,
|
||||
);
|
||||
// Open the panel even when the layer was already on, but never under
|
||||
// the Cockpit, which owns the screen (as the layer's own reveal).
|
||||
if (
|
||||
result?.ok === true &&
|
||||
current() &&
|
||||
!styleManager?.getCockpitState?.()?.active
|
||||
) {
|
||||
setPanelOpen(styleManager, 'space-missions-panel', true);
|
||||
}
|
||||
return {
|
||||
...result,
|
||||
action: 'set_context_mode',
|
||||
mode: 'space-missions',
|
||||
};
|
||||
}
|
||||
if (
|
||||
mode === 'off' &&
|
||||
!styleManager.getContextModeState?.()?.mode &&
|
||||
dataManager.isEnabled?.('rocket-launches')
|
||||
) {
|
||||
// "Exit Space Missions" still arrives as context off. With no Context
|
||||
// mode on, Space Missions is what is being left: switch its layer off.
|
||||
const result = await runGevAction(
|
||||
'set_layer_visibility',
|
||||
{ layerId: 'rocket-launches', enabled: false },
|
||||
runOptions,
|
||||
);
|
||||
return {
|
||||
...result,
|
||||
action: 'set_context_mode',
|
||||
mode: 'off',
|
||||
};
|
||||
}
|
||||
if (mode && mode !== 'off') {
|
||||
setPanelOpen(styleManager, 'global-context-panel', true);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user