mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
The launches layer keeps the replay state, projection and wording and presents the replay vehicle overlay through subscribeReplayOverlay(), sending nothing for an unchanged frame, so the portable launches entry stays free of Vue. The application shell publishes each presentation to the gev-mission-replay store and the scene chrome teleports the vehicle, orbit dot and callout into the globe container with the same markup, classes, mode, transform, rotation and sonar opacities. Hiding keeps the mode, place and text, as before.
23 lines
758 B
JavaScript
23 lines
758 B
JavaScript
import { defineStore } from 'pinia';
|
|
import { markRaw, shallowRef } from 'vue';
|
|
|
|
/**
|
|
* The Space Missions replay vehicle overlay as its view renders it. The
|
|
* launches layer presents it through `subscribeReplayOverlay()` and the
|
|
* application shell publishes each presentation here.
|
|
*/
|
|
export const useMissionReplayStore = defineStore('gev-mission-replay', () => {
|
|
/**
|
|
* `{visible, mode, thrusting, paused, transform, rotation, iconOpacity,
|
|
* labelOpacity, title, detail}`, or null while the layer has no overlay.
|
|
*/
|
|
const overlay = shallowRef(null);
|
|
|
|
/** @param {?object} next A fresh presentation; every publish re-renders. */
|
|
function publish(next) {
|
|
overlay.value = next && markRaw(next);
|
|
}
|
|
|
|
return { overlay, publish };
|
|
});
|