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!)
|
|
|
|
|
|
|
|
|
|
/** Show a building in the village overview, with its card open. */
|
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 hq = computed(() => village.value.buildings.find((b) => b.type === 'headquarters') ?? null)
|
|
|
|
|
|
2026-10-29 13:38:34 +00:00
|
|
|
const { t } = useI18n()
|
|
|
|
|
/** A building's name opens its own screen. */
|
|
|
|
|
function showBuilding(id: number) {
|
|
|
|
|
const b = village.value.buildings.find((x) => x.id === id)
|
|
|
|
|
if (b) navigateTo(buildingRoute(village.value, b))
|
|
|
|
|
}
|
2026-10-28 21:14:56 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- The headquarters screen: every building to construct, upgrade or tear down, and the queue. -->
|
|
|
|
|
<template>
|
2026-10-29 00:26:08 +00:00
|
|
|
<div class="space-y-3 p-2.5">
|
2026-10-29 13:38:34 +00:00
|
|
|
<VillageBuildingHeader
|
|
|
|
|
v-if="hq"
|
|
|
|
|
:building="hq"
|
|
|
|
|
:title="buildingName(village, hq, 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="headquarters" :level="null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" />
|
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
|
|
|
<VillageBuildForm
|
|
|
|
|
:options="village.buildable"
|
|
|
|
|
:buildings="village.buildings"
|
|
|
|
|
:space="village.space"
|
|
|
|
|
:resources="resources"
|
|
|
|
|
:can-afford="v.canAfford"
|
|
|
|
|
:busy="v.busy.value"
|
2026-10-29 09:15:36 +00:00
|
|
|
:hint="typeof route.query.hint === 'string' ? route.query.hint : null"
|
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
|
|
|
@build="v.build"
|
|
|
|
|
@upgrade="v.upgrade"
|
|
|
|
|
@demolish="v.demolish"
|
2026-10-29 13:38:34 +00:00
|
|
|
@select="showBuilding"
|
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
|
|
|
/>
|
|
|
|
|
<VillageBuildQueue
|
|
|
|
|
:queue="village.queue"
|
|
|
|
|
:builders="village.builders"
|
|
|
|
|
:seconds-until="v.secondsUntil"
|
|
|
|
|
:busy="v.busy.value"
|
|
|
|
|
@cancel="v.cancel"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2026-10-28 21:14:56 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|