mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(globe): answer both reset buttons through the globe actions store
The top-center and cockpit reset buttons call the location controls' new reset() through the globe actions store, and render a reset under way from it, instead of the location controls binding their clicks and the navigation writing their labels. The store keeps each owner's reset under way like its clear, and controls replaced mid-reset keep it on the buttons. LocationControls no longer takes resetButtons.
This commit is contained in:
1 parent
eccaeea0c4
commit
b4ee2321cf
17 files changed
+173
-84
No files matched your search
@@ -9,6 +9,7 @@ import {
|
||||
} from '../cockpitInstrumentState.js';
|
||||
import { vClassToggle } from '../rail/classToggle.js';
|
||||
import { useCockpitStore } from '../stores/cockpit.js';
|
||||
import { useGlobeActionsStore } from '../stores/globeActions.js';
|
||||
import CockpitBriefing from './panels/CockpitBriefing.vue';
|
||||
import CockpitContext from './panels/CockpitContext.vue';
|
||||
import CockpitRollingValue from './panels/CockpitRollingValue.vue';
|
||||
@@ -21,6 +22,8 @@ import CockpitUtilityControls from './panels/CockpitUtilityControls.vue';
|
||||
// keep its listeners.
|
||||
const { presence, instruments, route, vision } = storeToRefs(useCockpitStore());
|
||||
const active = computed(() => Boolean(presence.value?.active));
|
||||
const globe = useGlobeActionsStore();
|
||||
const { resetBusy } = storeToRefs(globe);
|
||||
const initialInstruments = createInstrumentState();
|
||||
const initialRoute = createRouteState();
|
||||
const initialVision = createVisionState();
|
||||
@@ -188,7 +191,7 @@ const tickStyle = (tick) =>
|
||||
</section>
|
||||
|
||||
<nav id="view-switcher" aria-label="View switcher" data-i18n-aria-label>
|
||||
<button id="cockpit-reset-globe" type="button" aria-label="Reset cockpit to full globe view" title="Exit cockpit and return to full globe view" :hidden="!active" data-i18n-aria-label data-i18n-title>
|
||||
<button id="cockpit-reset-globe" type="button" :aria-label="resetBusy ? t('Resetting cockpit to full globe view') : t('Reset cockpit to full globe view')" title="Exit cockpit and return to full globe view" :hidden="!active" data-i18n-title @click="globe.act('reset')">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">public</span>
|
||||
<span data-i18n>RESET</span>
|
||||
</button>
|
||||
|
||||
@@ -11,7 +11,7 @@ import GlobeCompass from './GlobeCompass.vue';
|
||||
// changes on every frame a rotating camera draws, so only the compass reads
|
||||
// it; the bar renders again only when the tilt changes.
|
||||
const globe = useGlobeActionsStore();
|
||||
const { clearBusy, camera } = storeToRefs(globe);
|
||||
const { clearBusy, resetBusy, camera } = storeToRefs(globe);
|
||||
const { act } = globe;
|
||||
const tilted = computed(() => Boolean(camera.value?.tilted));
|
||||
</script>
|
||||
@@ -28,7 +28,7 @@ const tilted = computed(() => Boolean(camera.value?.tilted));
|
||||
<span class="material-symbols-outlined" aria-hidden="true">view_in_ar</span>
|
||||
</button>
|
||||
<GlobeCompass @click="act('northUp')" />
|
||||
<button id="reset-globe-view" type="button" aria-label="Reset to full globe view" title="Reset camera and return to full globe view" data-i18n-aria-label data-i18n-title>
|
||||
<button id="reset-globe-view" type="button" :aria-label="resetBusy ? t('Resetting to full globe view') : t('Reset to full globe view')" title="Reset camera and return to full globe view" data-i18n-title @click="act('reset')">
|
||||
<span class="material-symbols-outlined" aria-hidden="true">public</span>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
Reference in new issue
Block a user