mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(world-overlay): render the visible map target list from a store
The world overlay presents its focusable mirror of painted cards through subscribeWorldOverlayActions() and answers activateWorldOverlayAction(); the application shell publishes the list to a store and the scene chrome renders the buttons and the status, announcing a repeated focus again. The module stays free of Vue for the portable transit entry, and its canvases remain painting surfaces.
This commit is contained in:
1 parent
662f51fdf3
commit
b22e138c55
11 files changed
+297
-82
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { markRaw, shallowRef } from 'vue';
|
||||
|
||||
/**
|
||||
* The visible map target list as its view renders it. The world overlay
|
||||
* (src/overlays/worldOverlay.js) presents the actionable cards it painted and
|
||||
* the last focus announcement; the application shell publishes them here and
|
||||
* connects the overlay's activation.
|
||||
*/
|
||||
export const useWorldOverlayActionsStore = defineStore(
|
||||
'gev-world-overlay-actions',
|
||||
() => {
|
||||
/**
|
||||
* `{owner, items: [{key, label, selected}], status}`, or null without an
|
||||
* overlay host. `owner` is passed back with each activation.
|
||||
*/
|
||||
const actions = shallowRef(null);
|
||||
|
||||
/** @param {?object} next A fresh presentation; every publish re-renders. */
|
||||
function publish(next) {
|
||||
actions.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
/** The controls whose `activate(owner, key)` a target button calls. */
|
||||
const controls = shallowRef(null);
|
||||
|
||||
/** @param {?object} next The controls, or null to disconnect. */
|
||||
function connect(next) {
|
||||
controls.value = next && markRaw(next);
|
||||
}
|
||||
|
||||
return { actions, publish, controls, connect };
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user