2026-10-28 23:38:54 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const { current } = useCurrentWorld()
|
|
|
|
|
|
|
|
|
|
/**
|
2026-10-29 00:26:08 +00:00
|
|
|
* The village whose header stays on top of every screen in the world: the one in the
|
2026-10-28 23:38:54 +00:00
|
|
|
* URL on village screens, else the one last opened in this world (map, reports).
|
|
|
|
|
*/
|
2026-10-29 09:56:52 +00:00
|
|
|
/** The village's own screens draw their menu over the fullscreen village themselves. */
|
|
|
|
|
const onVillage = computed(() => route.path.startsWith('/village/'))
|
|
|
|
|
|
2026-10-28 23:38:54 +00:00
|
|
|
const villageId = computed(() => {
|
|
|
|
|
if (route.path.startsWith('/village/')) return Number(route.params.id)
|
|
|
|
|
const worldId = Number(route.params.worldId)
|
|
|
|
|
return current.value && current.value.worldId === worldId ? current.value.villageId : null
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-10-29 00:26:08 +00:00
|
|
|
<!-- Inside a world: the main menu, then the village header and its screens, like Die Stämme. -->
|
2026-10-28 23:38:54 +00:00
|
|
|
<template>
|
2026-10-29 00:26:08 +00:00
|
|
|
<div class="min-h-dvh pb-14 md:pb-0">
|
2026-10-29 09:56:52 +00:00
|
|
|
<GameMenuBar v-if="!onVillage" in-world />
|
2026-10-28 23:38:54 +00:00
|
|
|
<GameVillageFrame v-if="villageId" :key="villageId" :village-id="villageId">
|
|
|
|
|
<slot />
|
|
|
|
|
</GameVillageFrame>
|
2026-10-29 00:26:08 +00:00
|
|
|
<main v-else class="mx-auto max-w-[1100px] px-1 pt-1.5 pb-4 sm:px-2">
|
|
|
|
|
<div class="frame">
|
|
|
|
|
<slot />
|
|
|
|
|
</div>
|
2026-10-28 23:38:54 +00:00
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|