2026-10-28 23:38:54 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
const props = defineProps<{ villageId: number }>()
|
|
|
|
|
|
|
|
|
|
// One village state for every screen in the world: the village bar, the village's own
|
|
|
|
|
// screens, the map and the reports all read it through useVillageContext().
|
|
|
|
|
const v = useVillage(props.villageId)
|
|
|
|
|
provideVillage(v)
|
|
|
|
|
v.refresh()
|
|
|
|
|
|
|
|
|
|
const { enter } = useCurrentWorld()
|
|
|
|
|
watch(v.village, (state) => {
|
|
|
|
|
if (state) enter(state.world_id, state.id)
|
|
|
|
|
})
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
|
|
|
|
|
// One key per screen of the world, as the tab titles show.
|
|
|
|
|
useShortcuts(() => {
|
|
|
|
|
const base = `/village/${props.villageId}`
|
|
|
|
|
const worldId = v.village.value?.world_id
|
|
|
|
|
return {
|
|
|
|
|
...Object.fromEntries(VILLAGE_SCREENS.map((s) => [s.name, `${base}${s.path}`])),
|
|
|
|
|
...(worldId ? { map: `/map/${worldId}`, reports: `/reports/${worldId}` } : {}),
|
|
|
|
|
}
|
|
|
|
|
})
|
2026-10-28 23:38:54 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<GameVillageBar v-if="v.village.value && v.resources.value" :village="v.village.value" :resources="v.resources.value" />
|
feat: rally point tabs, map village popups, report filters, beginner protection bar, keyboard shortcuts
Ideas taken from how Die Stämme works, in our own look: the rally point splits into
commands, troops and simulator; hovering a village on the map shows its owner, points
and distance, a click offers send troops and centre; reports filter by attacks,
defence and support; a dismissible bar counts down beginner protection; one key per
screen (V, H, T, P, W, M, R); resources in the village bar lead to the workforce.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:00:13 +00:00
|
|
|
<GameProtectionBar
|
|
|
|
|
v-if="v.village.value?.rally.protected_until"
|
|
|
|
|
:until="v.village.value.rally.protected_until"
|
|
|
|
|
:village-id="villageId"
|
|
|
|
|
:seconds-until="v.secondsUntil"
|
|
|
|
|
/>
|
2026-10-28 23:38:54 +00:00
|
|
|
<VillageFoodWarning
|
|
|
|
|
v-if="v.village.value"
|
|
|
|
|
:starvation="v.village.value.starvation"
|
|
|
|
|
:levy="v.village.value.levy"
|
|
|
|
|
:seconds-until="v.secondsUntil"
|
|
|
|
|
/>
|
|
|
|
|
<p v-if="v.error.value" class="alert mx-4 mt-3 sm:mx-6" role="alert">{{ v.error.value }}</p>
|
|
|
|
|
<main>
|
|
|
|
|
<slot />
|
|
|
|
|
</main>
|
|
|
|
|
<GameTabBar :village-id="villageId" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|