mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Preserve satellite tracking, orbit solutions and mission replay across globes
This commit is contained in:
1 parent
133ca14119
commit
a49671a391
21 files changed
+446
-71
No files matched your search
@@ -625,7 +625,7 @@ export class StyleManager extends ShellFacade {
|
||||
this._publishActiveStyle();
|
||||
this._updateLocationMiniStatus();
|
||||
|
||||
this._shareRestoration.start({ engineSwitch });
|
||||
this._shareRestoration.start({ engineSwitch, retainScene: Boolean(this._layerSession?.handoffLayers) });
|
||||
|
||||
// Keep the parameter panel from overlapping toggle controls.
|
||||
this._layoutRightPanels();
|
||||
@@ -976,7 +976,7 @@ export class StyleManager extends ShellFacade {
|
||||
},
|
||||
});
|
||||
if (this._layerSession?.handoffLayers)
|
||||
this._contextControls.resumeScene(this._layerSession.contacts);
|
||||
this._contextControls.resumeScene(this._layerSession.contextScene);
|
||||
// The Contacts layer publishes its panel; the view calls its navigation.
|
||||
contextStore.connectAwareness(militaryAwarenessLayer);
|
||||
// A panel left by an earlier shell must not outlive its layer.
|
||||
@@ -1856,15 +1856,15 @@ export class StyleManager extends ShellFacade {
|
||||
// re-enable a mode's entry layer and republish `_contextMode` while the
|
||||
// rest of teardown is tearing those very layers down.
|
||||
this._contextControls.stop();
|
||||
this._navigation.destroy();
|
||||
this._navigation.destroy({ retainScene: Boolean(this._layerSession?.handoffLayers) });
|
||||
// Close camera-entry seams synchronously. Context restoration may await
|
||||
// layer work, so leaving these listeners attached until afterward lets a
|
||||
// focus event release tracking or start a flight during teardown.
|
||||
if (this._layerSession && !this._layerSession.lifetime.signal.aborted &&
|
||||
this._contextControls.canRetainContacts()) {
|
||||
this._layerSession.contacts = this._contextControls.captureScene();
|
||||
this._contextControls.canRetainScene()) {
|
||||
this._layerSession.contextScene = this._contextControls.captureScene();
|
||||
} else {
|
||||
if (this._layerSession) this._layerSession.contacts = null;
|
||||
if (this._layerSession) this._layerSession.contextScene = null;
|
||||
await this._contextControls.restoreForDisposal();
|
||||
}
|
||||
// IR boost teardown BEFORE detaching the data manager: restore fog and
|
||||
|
||||
@@ -85,8 +85,8 @@ export class ContextControls {
|
||||
this[field] = null;
|
||||
}
|
||||
}
|
||||
canRetainContacts() {
|
||||
return this._contextMode === 'flights' && !this._contextModeChanging &&
|
||||
canRetainScene() {
|
||||
return ['flights', 'space-missions'].includes(this._contextMode) && !this._contextModeChanging &&
|
||||
!this._contextRestoreState && !this._clearSelectedLayersPromise &&
|
||||
!this._contextLayerReactionPromises.size;
|
||||
}
|
||||
|
||||
@@ -280,8 +280,8 @@ export class NavigationController {
|
||||
this._cameraHandoffs?.publish();
|
||||
this._cameraHandoffs?.destroy();
|
||||
}
|
||||
destroy() {
|
||||
destroy({ retainScene = false } = {}) {
|
||||
this.stop();
|
||||
this._stampNavigation();
|
||||
this._stampNavigation({cancelPendingSelection: !retainScene});
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,7 @@ export class ShareRestoration {
|
||||
this.shareLinkManager = shareLinkManager;
|
||||
this._initialShareState = shareLinkManager.parseInitialHash();
|
||||
}
|
||||
start({ engineSwitch = false } = {}) {
|
||||
start({ engineSwitch = false, retainScene = false } = {}) {
|
||||
// Restore from URL hash if present
|
||||
const savedState = this._initialShareState;
|
||||
this._initialShareRestorePromise = savedState
|
||||
@@ -181,12 +181,13 @@ export class ShareRestoration {
|
||||
Number.isInteger(generation) &&
|
||||
this.navigation._reassertNavigationHandoff(generation, {
|
||||
trackingOrigin: engineSwitch ? 'share-restore' : 'tool',
|
||||
keepTracking: Boolean(retained),
|
||||
keepTracking: retainScene || Boolean(retained),
|
||||
});
|
||||
void this._runShareRestore(savedState, {
|
||||
applyCamera,
|
||||
instant: engineSwitch,
|
||||
retained,
|
||||
retainScene,
|
||||
navigationToken: generation,
|
||||
layersPromise: this._layerStateRestorePromise,
|
||||
settle: (result) => this._settleInitialShareRestore(result),
|
||||
@@ -245,7 +246,7 @@ export class ShareRestoration {
|
||||
*/
|
||||
async _runShareRestore(
|
||||
state,
|
||||
{ applyCamera, instant = false, retained, navigationToken, layersPromise, settle },
|
||||
{ applyCamera, instant = false, retained, retainScene = false, navigationToken, layersPromise, settle },
|
||||
) {
|
||||
const generation = this._shareRestoreGeneration;
|
||||
const current = () =>
|
||||
@@ -258,6 +259,7 @@ export class ShareRestoration {
|
||||
});
|
||||
const layers = await (layersPromise || Promise.resolve([]));
|
||||
if (!current()) return;
|
||||
if (retainScene && !retained) retained = this._layerStateCoordinator?.retainedTrackingTarget();
|
||||
const tracking =
|
||||
share.camera === 'applied'
|
||||
? (retained && this._layerStateCoordinator.resumeRetainedTracking(retained)) ||
|
||||
|
||||
Reference in new issue
Block a user