2026-10-28 21:14:56 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
const route = useRoute()
|
|
|
|
|
const v = useVillageContext()
|
|
|
|
|
const village = computed(() => v.village.value!)
|
|
|
|
|
const resources = computed(() => v.resources.value!)
|
|
|
|
|
|
|
|
|
|
/** Military building whose tab is open; `?at=` picks one. */
|
|
|
|
|
const recruitAt = ref<number | null>(Number(route.query.at) || null)
|
|
|
|
|
watch(
|
|
|
|
|
() => route.query.at,
|
|
|
|
|
(at) => (recruitAt.value = Number(at) || recruitAt.value),
|
|
|
|
|
)
|
feat: building portraits, screen headers and a livelier village: shadows, smoke, walkers, a pond
Each building screen opens with the building drawn as it stands, its level and what it
does; the HQ list and the building cards show the same portraits. In the village,
buildings and trees cast flat shadows, chimneys, forges and kilns smoke, villagers walk
the roads to the zones they work in (more where more work), and a pond lies in the
meadow. Motion stops for players who prefer reduced motion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:46:15 +00:00
|
|
|
const shown = computed(() => village.value.military.find((m) => m.building_id === recruitAt.value) ?? village.value.military[0] ?? null)
|
2026-10-29 13:38:34 +00:00
|
|
|
const shownBuilding = computed(() => village.value.buildings.find((b) => b.id === shown.value?.building_id) ?? null)
|
|
|
|
|
const { t } = useI18n()
|
2026-10-28 21:14:56 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- Recruiting at every military building, the troops at home and the levy. -->
|
|
|
|
|
<template>
|
2026-10-30 11:11:15 +00:00
|
|
|
<VillageScreenLayout>
|
|
|
|
|
<template #side>
|
|
|
|
|
<VillageBuildingHeader
|
|
|
|
|
v-if="shownBuilding"
|
|
|
|
|
:building="shownBuilding"
|
|
|
|
|
:title="buildingName(village, shownBuilding, t)"
|
|
|
|
|
:resources="v.resources.value!"
|
|
|
|
|
:can-afford="v.canAfford"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
@upgrade="v.upgrade"
|
|
|
|
|
@demolish="v.demolish"
|
|
|
|
|
@priority="v.setPriority"
|
|
|
|
|
/>
|
|
|
|
|
<VillageScreenHeader
|
|
|
|
|
v-else
|
|
|
|
|
:type="shown?.type ?? 'barracks'"
|
|
|
|
|
:level="shown?.level ?? null"
|
|
|
|
|
:title="shown ? $t(`buildings.${shown.type}`) : $t('village.screens.recruit')"
|
|
|
|
|
:description="$t('village.about.recruit')"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
|
2026-10-29 09:56:52 +00:00
|
|
|
<div class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_18rem]">
|
feat: building portraits, screen headers and a livelier village: shadows, smoke, walkers, a pond
Each building screen opens with the building drawn as it stands, its level and what it
does; the HQ list and the building cards show the same portraits. In the village,
buildings and trees cast flat shadows, chimneys, forges and kilns smoke, villagers walk
the roads to the zones they work in (more where more work), and a pond lies in the
meadow. Motion stops for players who prefer reduced motion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:46:15 +00:00
|
|
|
<VillageRecruit
|
|
|
|
|
v-if="village.military.length"
|
|
|
|
|
v-model:selected="recruitAt"
|
|
|
|
|
:military="village.military"
|
|
|
|
|
:troops="village.troops"
|
|
|
|
|
:villagers="village.population.villagers - village.levy.militia"
|
|
|
|
|
:resources="resources"
|
|
|
|
|
:seconds-until="v.secondsUntil"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
:recruit="v.recruit"
|
|
|
|
|
@cancel="v.cancelRecruit"
|
|
|
|
|
/>
|
|
|
|
|
<section v-else class="panel">
|
|
|
|
|
<div class="panel-body py-8 text-center text-sm text-ink-500">{{ $t('village.troops.hint') }}</div>
|
|
|
|
|
</section>
|
2026-10-29 09:33:26 +00:00
|
|
|
<div class="space-y-3">
|
|
|
|
|
<VillageCoinPanel v-if="shown?.type === 'academy'" :conquest="village.conquest" :resources="resources" :busy="v.busy.value" @mint="v.mint" />
|
|
|
|
|
<VillageTroopsPanel
|
|
|
|
|
:troops="village.troops"
|
|
|
|
|
:training="village.population.training"
|
|
|
|
|
:levy="village.levy"
|
|
|
|
|
:villagers="village.population.villagers"
|
|
|
|
|
:seconds-until="v.secondsUntil"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
@levy="v.levy"
|
|
|
|
|
@end-levy="v.endLevy"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
feat: building portraits, screen headers and a livelier village: shadows, smoke, walkers, a pond
Each building screen opens with the building drawn as it stands, its level and what it
does; the HQ list and the building cards show the same portraits. In the village,
buildings and trees cast flat shadows, chimneys, forges and kilns smoke, villagers walk
the roads to the zones they work in (more where more work), and a pond lies in the
meadow. Motion stops for players who prefer reduced motion.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:46:15 +00:00
|
|
|
</div>
|
2026-10-30 11:11:15 +00:00
|
|
|
</VillageScreenLayout>
|
2026-10-28 21:14:56 +00:00
|
|
|
</template>
|