mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 09:12:18 +00:00
The title logo goes back to live at the starting view
The logo in the title was only a picture. It is now a button, "Back to live at the starting view": the world clock goes live and the camera flies to the view the app started from, letting go of whatever it follows as Reset Globe does. The shell's returnToStart() does it. It flies to the `homeView` option of createApplicationControls, which is the start view unless given: an application that passes `startView` only to carry a view across a rebuild can keep the logo on its own first view. START_VIEW is exported from ./application/controls for that. The title heading keeps "GOD'S EYE VIEW" as its name beside the button.
This commit is contained in:
1 parent
4c90c065be
commit
f5d3521cda
25 files changed
+191
-32
No files matched your search
@@ -106,6 +106,9 @@ export class StyleManager extends ShellFacade {
|
||||
* @param {object} [options]
|
||||
* @param {boolean} [options.localePicker=true] - false removes the language
|
||||
* picker, for a host that offers its own language choice.
|
||||
* @param {{lon: number, lat: number, height: number, heading?: number,
|
||||
* pitch?: number}|null} [options.homeView] - where the title's logo goes
|
||||
* back to (degrees): the view the app started from.
|
||||
*/
|
||||
constructor(
|
||||
viewer,
|
||||
@@ -116,6 +119,7 @@ export class StyleManager extends ShellFacade {
|
||||
requestServices,
|
||||
initialShareCode = null,
|
||||
localePicker = true,
|
||||
homeView = null,
|
||||
} = {},
|
||||
) {
|
||||
super();
|
||||
@@ -341,6 +345,7 @@ export class StyleManager extends ShellFacade {
|
||||
this._locationNavigation = new LocationNavigation({
|
||||
viewer,
|
||||
placeSearch,
|
||||
homeView,
|
||||
navigation: this._navigation,
|
||||
readCockpit: () => this.cockpitView,
|
||||
services: {
|
||||
@@ -1717,7 +1722,12 @@ export class StyleManager extends ShellFacade {
|
||||
const store = useGlobeActionsStore(applicationPinia());
|
||||
if (this._resetToken) store.detach(this._resetToken);
|
||||
this._resetToken = controls
|
||||
? store.connect({ reset: () => controls.reset() })
|
||||
? store.connect({
|
||||
reset: () => controls.reset(),
|
||||
home: () => {
|
||||
if (!this._disposed) void this.returnToStart();
|
||||
},
|
||||
})
|
||||
: null;
|
||||
// A reset under way as the controls are replaced stays on the buttons.
|
||||
if (this._resetToken && this._globeResetting != null)
|
||||
|
||||
Reference in new issue
Block a user