mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(awareness): render the Global Context compass from a store
The awareness layer presents the compass ring, heading, cardinal labels and contact bearing markers through subscribeDirectionOverlay(); the application shell publishes them to the gev-awareness-direction store and the scene chrome renders them in the viewer's container.
This commit is contained in:
1 parent
b22e138c55
commit
b96cc37ab5
14 files changed
+389
-100
No files matched your search
@@ -14,6 +14,7 @@ import SplitFlapText from './panels/SplitFlapText.vue';
|
||||
import WindInspectionMarker from './panels/WindInspectionMarker.vue';
|
||||
import CelestialRing from './panels/CelestialRing.vue';
|
||||
import ScreenAnnotations from './panels/ScreenAnnotations.vue';
|
||||
import AwarenessDirection from './panels/AwarenessDirection.vue';
|
||||
|
||||
// The ACTIVE STYLE corner shows the style VisualSettings publishes.
|
||||
const { style } = storeToRefs(useDisplayStore());
|
||||
@@ -127,4 +128,5 @@ const vToastText = {
|
||||
<WindInspectionMarker />
|
||||
<MissionReplayOverlay />
|
||||
<ScreenAnnotations />
|
||||
<AwarenessDirection />
|
||||
</template>
|
||||
@@ -0,0 +1,18 @@
|
||||
<script setup>
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useAwarenessDirectionStore } from '../../stores/awarenessDirection.js';
|
||||
|
||||
// The Global Context compass and the nearest contacts' bearings, inside the
|
||||
// viewer's container, as the awareness layer presents them.
|
||||
const { overlay } = storeToRefs(useAwarenessDirectionStore());
|
||||
|
||||
// A part keeps no inline placement until the layer first places it.
|
||||
const place = (part) =>
|
||||
part.left === null ? undefined : { left: part.left, top: part.top };
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Teleport v-if="overlay" :to="overlay.container">
|
||||
<div id="military-awareness-direction-overlay" :hidden="overlay.hidden" aria-hidden="true"><span v-for="label in overlay.labels" :key="label.label" :class="`military-awareness-compass-label cardinal-${label.label.toLowerCase()}`" :data-bearing="String(label.bearing)" :style="place(label)">{{ label.label }}</span><div class="military-awareness-compass-ring" :style="overlay.ring ?? undefined"></div><span class="military-awareness-compass-heading" :style="place(overlay.heading)">{{ overlay.heading.text }}</span><div v-for="(marker, index) in overlay.markers" :key="index" class="military-awareness-direction-marker" :hidden="marker.hidden" :style="marker.style ?? undefined"><span class="military-awareness-direction-arrow" :style="marker.arrow ?? undefined">➜</span><span class="military-awareness-direction-label" :style="marker.caption.style ?? undefined">{{ marker.caption.text }}</span></div></div>
|
||||
</Teleport>
|
||||
</template>
|
||||
Reference in new issue
Block a user