feat: the village fills the screen; menu, village bar, overview boxes and screens dock over it as windows

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Fabian @ Blax Software 2026-10-29 10:56:52 +01:00
parent eeaa0f8d6f
commit 8218b7d98e
13 changed files with 183 additions and 55 deletions

View File

@ -10,7 +10,8 @@ This is the Nuxt client for a browser strategy game in the style of Tribal Wars.
- **Dense and plain, like the old browser strategy games** (the reference is Die Stämme; notes and screenshots in the sibling repo `game-village-politics-research` (`../game-village-politics-research/die-staemme/`), kept out of this repo). A 14 px base, square frames with thin lines, tan header bands, tight table rows (`.grid-table`), small squared buttons (`.btn-primary` dark wood, `.btn-attack` red for attacks only), thin notice bars. No rounded cards, pills, big padding or decorative icons: an icon only where it carries meaning. Theme and component classes live in `app/assets/css/main.css`; hand-written inline SVG graphics in `app/components/icon/`, colours in `app/utils/palette.ts`. No paid, hosted or licensed assets: no icon packs, web fonts or images from outside the repo, and nothing copied from Die Stämme. - **Dense and plain, like the old browser strategy games** (the reference is Die Stämme; notes and screenshots in the sibling repo `game-village-politics-research` (`../game-village-politics-research/die-staemme/`), kept out of this repo). A 14 px base, square frames with thin lines, tan header bands, tight table rows (`.grid-table`), small squared buttons (`.btn-primary` dark wood, `.btn-attack` red for attacks only), thin notice bars. No rounded cards, pills, big padding or decorative icons: an icon only where it carries meaning. Theme and component classes live in `app/assets/css/main.css`; hand-written inline SVG graphics in `app/components/icon/`, colours in `app/utils/palette.ts`. No paid, hosted or licensed assets: no icon packs, web fonts or images from outside the repo, and nothing copied from Die Stämme.
- **The village is a ground-level land view** (`app/components/village/Diorama.vue`, geometry in `app/diorama/`): isometric low-poly, drawn as inline SVG, no WebGL. The land fills the frame edge to edge (no island, no sky), cut to the container's shape; narrow screens scroll sideways. There are no tiles or positions: the server only sends each building's `space` and the village's `space.used/max`, and the client lays everything out deterministically in id order. The village core sits in the middle (headquarters on the plaza, storage, hiding places and rally point around it, inside the wall ring when there is one, a dirt edge without). Resource sites stand outside in their zones: iron mines at the rocky hill (upper left), clay pits on clay ground (lower left), timber camps at the forest edge (lower right), farms with fields (right); dirt roads lead from the gates to each zone and forest fills the rest. Levels start at 1. Each type has a model per level tier (1–4, 5–14, 15+); the wall goes stakes → timber → stone with towers. Buildings are focusable buttons that open their details card; a type that doesn't stand yet keeps an invisible empty plot that opens its build card. Buildings never move or light up on hover: only a click outlines the ground under them. Ambient life is welcome and stays out of the way: flat ground shadows, smoke from chimneys, forges and kilns, villagers walking the roads to the zones they work in; all motion stops under `prefers-reduced-motion`. The same models draw the building portraits on screen headers, the HQ list and the building cards (`VillageBuildingPortrait`). The world map groups forests, lakes and rocky hills by smooth noise of the coordinates, and village markers grow in five sizes with points. Map coordinates run around 0|0, negative included (−500 to 499 on a 1000-field map, lowest value from `map.view`'s `min`); continents are named from the top-left like Die Stämme, so 0|0 is the corner of K44, K45, K54 and K55. Use `app/utils/map.ts` for bounds and continents, never `0` or `500` literals. - **The village is a ground-level land view** (`app/components/village/Diorama.vue`, geometry in `app/diorama/`): isometric low-poly, drawn as inline SVG, no WebGL. The land fills the frame edge to edge (no island, no sky), cut to the container's shape; narrow screens scroll sideways. There are no tiles or positions: the server only sends each building's `space` and the village's `space.used/max`, and the client lays everything out deterministically in id order. The village core sits in the middle (headquarters on the plaza, storage, hiding places and rally point around it, inside the wall ring when there is one, a dirt edge without). Resource sites stand outside in their zones: iron mines at the rocky hill (upper left), clay pits on clay ground (lower left), timber camps at the forest edge (lower right), farms with fields (right); dirt roads lead from the gates to each zone and forest fills the rest. Levels start at 1. Each type has a model per level tier (1–4, 5–14, 15+); the wall goes stakes → timber → stone with towers. Buildings are focusable buttons that open their details card; a type that doesn't stand yet keeps an invisible empty plot that opens its build card. Buildings never move or light up on hover: only a click outlines the ground under them. Ambient life is welcome and stays out of the way: flat ground shadows, smoke from chimneys, forges and kilns, villagers walking the roads to the zones they work in; all motion stops under `prefers-reduced-motion`. The same models draw the building portraits on screen headers, the HQ list and the building cards (`VillageBuildingPortrait`). The world map groups forests, lakes and rocky hills by smooth noise of the coordinates, and village markers grow in five sizes with points. Map coordinates run around 0|0, negative included (−500 to 499 on a 1000-field map, lowest value from `map.view`'s `min`); continents are named from the top-left like Die Stämme, so 0|0 is the corner of K44, K45, K54 and K55. Use `app/utils/map.ts` for bounds and continents, never `0` or `500` literals.
- **Flat medieval colours only**, in the diorama and everywhere else: no gradients (CSS or SVG), no blur or backdrop-blur, no SVG filters or glows, no translucent overlays. Depth comes from the three flat shades per face in `app/diorama/iso.ts`, solid borders and hard shadows. Keep components small and typed, with state in composables (`useVillage`, `useWorld`). - **Flat medieval colours only**, in the diorama and everywhere else: no gradients (CSS or SVG), no blur or backdrop-blur, no SVG filters or glows, no translucent overlays. Depth comes from the three flat shades per face in `app/diorama/iso.ts`, solid borders and hard shadows. Keep components small and typed, with state in composables (`useVillage`, `useWorld`).
- **One game shell, like Die Stämme.** Everything sits in one centred column (1100 px). Pages inside a world (village screens, map, reports) use `layouts/game.vue`: the dark main menu (`GameMenuBar`: village, map, reports with its count inline, each with a hover dropdown of its sub-pages; server clock; account dropdown), then the village header (`GameVillageBar`: a quick bar with the village's screens, and one row with the village, its stock in thin cells and incoming troops), thin notices, and the content in a `.frame`. On phones the screens move to a bottom tab bar (`GameTabBar`). The header's village is the URL's on village screens and the last opened one elsewhere; `GameVillageFrame` holds its one `useVillage()` and shares it through `useVillageContext()`. Pages outside a world use `layouts/default.vue` (menu only). A page has one of two shapes: a title with box tabs (`UiSubTabs`: buildings like the rally point) or a title with a sub-menu on the left (`UiSideMenu`: lists like reports). One key per screen (`useShortcuts`): V overview, H headquarters, T recruit, P rally point, W workforce, M map, R reports. The overview stays clean: the village and a narrow column of boxes (incoming attacks, production, units, population, construction); tables live on the building screens. The map shows a popup over a hovered village and actions under a clicked one. The village row starts with the quest book (`QuestBook`, a native `<dialog>` without a veil): it opens by itself when `quests.claimable` goes up, and a goal's "show me" opens its screen, a building goal the headquarters with `?hint=<type>` marking that row. - **The village fills the screen.** On the village's own screens (`/village/<id>/…`) `GameVillageFrame` draws the diorama fixed across the whole browser window and docks everything over it, solid and opaque: the menu and the village bar along the top, the overview boxes in a right column (on phones a bottom sheet on the overview), and the open screen (headquarters, recruit, rally point, workforce) in a `UiWindow` on the left that folds and closes back to the overview; on the overview the left slot holds the card of the building picked in the village (`useVillageSelection`). Screen grids inside a window use container queries (`@4xl:`), not viewport breakpoints. The village scales to fit, no pan; on wide screens it is shifted by half the right column so it centres in the free area. Windows are docked now and meant to become draggable later, so `UiWindow` holds no position logic. This is where the game deliberately leaves Die Stämme's look behind.
- **One game shell for the rest.** The map and reports sit in one centred column (1100 px). Those pages (village screens, map, reports) use `layouts/game.vue`: the dark main menu (`GameMenuBar`: village, map, reports with its count inline, each with a hover dropdown of its sub-pages; server clock; account dropdown), then the village header (`GameVillageBar`: a quick bar with the village's screens, and one row with the village, its stock in thin cells and incoming troops), thin notices, and the content in a `.frame`. On phones the screens move to a bottom tab bar (`GameTabBar`). The header's village is the URL's on village screens and the last opened one elsewhere; `GameVillageFrame` holds its one `useVillage()` and shares it through `useVillageContext()`. Pages outside a world use `layouts/default.vue` (menu only). A page has one of two shapes: a title with box tabs (`UiSubTabs`: buildings like the rally point) or a title with a sub-menu on the left (`UiSideMenu`: lists like reports). One key per screen (`useShortcuts`): V overview, H headquarters, T recruit, P rally point, W workforce, M map, R reports. The overview stays clean: the village and a narrow column of boxes (incoming attacks, production, units, population, construction); tables live on the building screens. The map shows a popup over a hovered village and actions under a clicked one. The village row starts with the quest book (`QuestBook`, a native `<dialog>` without a veil): it opens by itself when `quests.claimable` goes up, and a goal's "show me" opens its screen, a building goal the headquarters with `?hint=<type>` marking that row.
- All user-facing text goes through i18n keys, with `en` as the first locale. Sources are `i18n/locales/` and `i18n/pages/` (`@blax-software/i18n` layout); register a new page file in `i18n/messageloader.ts`. vue-i18n reads a bare `|` as a plural separator and drops what follows, so coordinates in messages are written `"{x}{'|'}{y}"` inside a double-quoted string. - All user-facing text goes through i18n keys, with `en` as the first locale. Sources are `i18n/locales/` and `i18n/pages/` (`@blax-software/i18n` layout); register a new page file in `i18n/messageloader.ts`. vue-i18n reads a bare `|` as a plural separator and drops what follows, so coordinates in messages are written `"{x}{'|'}{y}"` inside a double-quoted string.
## Mock server ## Mock server

View File

@ -4,6 +4,8 @@ import type { UiIconName } from '~/components/icon/Ui.vue'
const props = defineProps<{ const props = defineProps<{
/** Inside a world: the world's menu (village, map, reports) and its clock. */ /** Inside a world: the world's menu (village, map, reports) and its clock. */
inWorld?: boolean inWorld?: boolean
/** Across the whole screen, over the fullscreen village, instead of the centred column. */
wide?: boolean
}>() }>()
const { t } = useI18n() const { t } = useI18n()
const { user, logout } = useAuth() const { user, logout } = useAuth()
@ -78,7 +80,7 @@ watch(() => route.fullPath, () => menuKey.value++)
<!-- The main menu on every page: one dark bar, every section with its dropdown, the server clock and the account. --> <!-- The main menu on every page: one dark bar, every section with its dropdown, the server clock and the account. -->
<template> <template>
<header class="border-b-2 border-wood-950 bg-wood-900 text-[13px] text-parchment-100"> <header class="border-b-2 border-wood-950 bg-wood-900 text-[13px] text-parchment-100">
<div :key="menuKey" class="mx-auto flex h-9 max-w-[1100px] items-stretch px-1 sm:px-2"> <div :key="menuKey" class="mx-auto flex h-9 items-stretch px-1 sm:px-2" :class="wide ? '' : 'max-w-[1100px]'">
<NuxtLink :to="home" class="mr-1 shrink-0 items-center gap-1.5 px-1.5" :class="entries.length ? 'hidden sm:flex' : 'flex'" :title="t('app.title')"> <NuxtLink :to="home" class="mr-1 shrink-0 items-center gap-1.5 px-1.5" :class="entries.length ? 'hidden sm:flex' : 'flex'" :title="t('app.title')">
<span class="grid size-6 place-items-center border border-gold-600 bg-blood-700 text-gold-400"> <span class="grid size-6 place-items-center border border-gold-600 bg-blood-700 text-gold-400">
<IconBuilding type="headquarters" class="size-4" /> <IconBuilding type="headquarters" class="size-4" />

View File

@ -31,6 +31,25 @@ watch(
}, },
) )
// On the village's own screens the village fills the screen and everything else docks
// over it; on the map and the reports the header sits above a framed page as before.
const route = useRoute()
const base = computed(() => `/village/${props.villageId}`)
const stage = computed(() => route.path.startsWith(base.value))
const overview = computed(() => route.path === base.value || route.path === `${base.value}/`)
const { selected, plot, clear } = useVillageSelection()
clear()
// Picking something in the village opens its card, which lives on the overview.
watch([selected, plot], ([b, p]) => {
if ((b || p) && stage.value && !overview.value) navigateTo(base.value)
})
const { t } = useI18n()
const screenTitle = computed(() => {
const s = VILLAGE_SCREENS.find((s) => s.path && route.path.startsWith(`${base.value}${s.path}`))
return s ? t(`village.screens.${s.name}`) : ''
})
const picked = computed(() => !!(selected.value || plot.value))
// One key per screen of the world, as the menu and quick bar titles show. // One key per screen of the world, as the menu and quick bar titles show.
useShortcuts(() => { useShortcuts(() => {
const base = `/village/${props.villageId}` const base = `/village/${props.villageId}`
@ -44,7 +63,66 @@ useShortcuts(() => {
<!-- The centred column: village header, thin notices, then the framed content. --> <!-- The centred column: village header, thin notices, then the framed content. -->
<template> <template>
<div> <!-- The village's own screens: the village fills the screen, bars and windows dock over it. -->
<div v-if="stage">
<!-- One column's width wider than the screen, starting off its left edge: the village
centres in the part the right column leaves free, and the land still runs under it. -->
<div class="fixed inset-y-0 right-0 left-0 z-0 lg:-left-60">
<VillageDiorama
v-if="v.village.value"
v-model:selected="selected"
v-model:plot="plot"
fill
:village="v.village.value"
:seconds-until="v.secondsUntil"
/>
</div>
<div class="pointer-events-none fixed inset-0 z-10 flex flex-col">
<div class="pointer-events-auto shrink-0">
<GameMenuBar in-world wide />
<div class="space-y-1 px-1 pt-1 sm:px-2">
<GameVillageBar v-if="v.village.value && v.resources.value" :village="v.village.value" :resources="v.resources.value" />
<GameProtectionBar
v-if="v.village.value?.rally.protected_until"
:until="v.village.value.rally.protected_until"
:village-id="villageId"
:seconds-until="v.secondsUntil"
/>
<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" role="alert">{{ v.error.value }}</p>
</div>
</div>
<div class="flex min-h-0 flex-1 items-start gap-2 p-1 pb-14 sm:p-2 md:pb-2">
<!-- Left: the open screen in a window, or on the overview the card of what is picked. -->
<div v-if="overview" v-show="picked" class="pointer-events-auto max-h-full w-full overflow-y-auto sm:w-80">
<slot />
</div>
<UiWindow v-else class="w-full max-w-[66rem]" :title="screenTitle" :close-to="base">
<slot />
</UiWindow>
<!-- Right: the boxes with the numbers that matter at a glance. -->
<div
v-if="v.village.value"
class="pointer-events-auto ml-auto max-h-full w-60 shrink-0 overflow-y-auto"
:class="overview && !picked ? 'max-lg:w-full max-lg:self-end max-lg:max-h-[45dvh]' : 'hidden lg:block'"
>
<VillageOverviewSidebar :village="v.village.value" :base="base" :seconds-until="v.secondsUntil" />
</div>
</div>
</div>
<GameTabBar :village-id="villageId" />
<QuestBook v-if="v.village.value" />
</div>
<!-- Map and reports: the village header above a framed page. -->
<div v-else>
<div class="mx-auto max-w-[1100px] space-y-1 px-1 pt-1.5 sm:px-2"> <div class="mx-auto max-w-[1100px] space-y-1 px-1 pt-1.5 sm:px-2">
<GameVillageBar v-if="v.village.value && v.resources.value" :village="v.village.value" :resources="v.resources.value" /> <GameVillageBar v-if="v.village.value && v.resources.value" :village="v.village.value" :resources="v.resources.value" />
<GameProtectionBar <GameProtectionBar

View File

@ -0,0 +1,42 @@
<script setup lang="ts">
import type { RouteLocationRaw } from 'vue-router'
defineProps<{
title: string
/** Where the close cross leads. */
closeTo?: RouteLocationRaw
/** A close cross that only emits `close`. */
closable?: boolean
}>()
const emit = defineEmits<{ close: [] }>()
/** Folded to its title bar, so the village behind shows. */
const folded = defineModel<boolean>('folded', { default: false })
</script>
<!--
A window over the fullscreen village, docked to an edge by its parent: a title bar
with fold and close, and its content scrolling inside. Solid like every other frame.
Kept free of position logic so it can become draggable later.
-->
<template>
<section class="pointer-events-auto flex max-h-full min-h-0 flex-col border border-wood-900 bg-parchment-100 shadow-[3px_3px_0_0_rgba(43,29,14,1)]">
<header class="flex shrink-0 items-center gap-1 border-b border-wood-700 bg-parchment-300 px-2 py-0.5">
<span class="panel-title min-w-0 flex-1 truncate">{{ title }}</span>
<button type="button" class="btn btn-ghost px-1" :title="$t(folded ? 'window.unfold' : 'window.fold')" :aria-expanded="!folded" @click="folded = !folded">
<IconUi :name="folded ? 'plus' : 'minus'" class="size-3.5" />
<span class="sr-only">{{ $t(folded ? 'window.unfold' : 'window.fold') }}</span>
</button>
<NuxtLink v-if="closeTo" :to="closeTo" class="btn btn-ghost px-1" :title="$t('window.close')" @click="emit('close')">
<IconUi name="close" class="size-3.5" />
<span class="sr-only">{{ $t('window.close') }}</span>
</NuxtLink>
<button v-else-if="closable" type="button" class="btn btn-ghost px-1" :title="$t('window.close')" @click="emit('close')">
<IconUi name="close" class="size-3.5" />
<span class="sr-only">{{ $t('window.close') }}</span>
</button>
</header>
<div v-show="!folded" class="@container min-h-0 overflow-y-auto">
<slot />
</div>
</section>
</template>

View File

@ -6,6 +6,8 @@ const props = defineProps<{
village: VillageState village: VillageState
/** Whole seconds until a server timestamp, on the server's clock. */ /** Whole seconds until a server timestamp, on the server's clock. */
secondsUntil: (iso: string) => number secondsUntil: (iso: string) => number
/** Fill the whole stage at any shape, without the sideways scroll of narrow frames. */
fill?: boolean
}>() }>()
/** Id of the building whose details are open. */ /** Id of the building whose details are open. */
const selected = defineModel<number | null>('selected', { default: null }) const selected = defineModel<number | null>('selected', { default: null })
@ -104,8 +106,8 @@ const timers = computed(() => {
</script> </script>
<template> <template>
<div ref="scroller" class="h-full w-full overflow-x-auto overflow-y-hidden bg-[#74864a]"> <div ref="scroller" class="h-full w-full overflow-y-hidden bg-[#74864a]" :class="fill ? 'overflow-x-hidden' : 'overflow-x-auto'">
<div ref="stage" class="h-full min-w-[640px]"> <div ref="stage" class="h-full" :class="fill ? '' : 'min-w-[640px]'">
<svg <svg
class="block h-full w-full select-none" class="block h-full w-full select-none"
:viewBox="scene.viewBox" :viewBox="scene.viewBox"

View File

@ -0,0 +1,15 @@
import type { BuildingType } from '~/types/game'
/**
* What is picked in the fullscreen village: a building (its card opens in the window)
* or the empty plot of a type that doesn't stand yet (its build card).
*/
export function useVillageSelection() {
const selected = useState<number | null>('village.selected', () => null)
const plot = useState<BuildingType | null>('village.plot', () => null)
const clear = () => {
selected.value = null
plot.value = null
}
return { selected, plot, clear }
}

View File

@ -6,6 +6,9 @@ const { current } = useCurrentWorld()
* The village whose header stays on top of every screen in the world: the one in the * The village whose header stays on top of every screen in the world: the one in the
* URL on village screens, else the one last opened in this world (map, reports). * URL on village screens, else the one last opened in this world (map, reports).
*/ */
/** The village's own screens draw their menu over the fullscreen village themselves. */
const onVillage = computed(() => route.path.startsWith('/village/'))
const villageId = computed(() => { const villageId = computed(() => {
if (route.path.startsWith('/village/')) return Number(route.params.id) if (route.path.startsWith('/village/')) return Number(route.params.id)
const worldId = Number(route.params.worldId) const worldId = Number(route.params.worldId)
@ -16,7 +19,7 @@ const villageId = computed(() => {
<!-- Inside a world: the main menu, then the village header and its screens, like Die Stämme. --> <!-- Inside a world: the main menu, then the village header and its screens, like Die Stämme. -->
<template> <template>
<div class="min-h-dvh pb-14 md:pb-0"> <div class="min-h-dvh pb-14 md:pb-0">
<GameMenuBar in-world /> <GameMenuBar v-if="!onVillage" in-world />
<GameVillageFrame v-if="villageId" :key="villageId" :village-id="villageId"> <GameVillageFrame v-if="villageId" :key="villageId" :village-id="villageId">
<slot /> <slot />
</GameVillageFrame> </GameVillageFrame>

View File

@ -14,7 +14,7 @@ const showInVillage = (id: number) => navigateTo({ path: `/village/${route.param
<template> <template>
<div class="space-y-3 p-2.5"> <div class="space-y-3 p-2.5">
<VillageScreenHeader type="headquarters" :level="hq?.level ?? null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" /> <VillageScreenHeader type="headquarters" :level="hq?.level ?? null" :title="$t('buildings.headquarters')" :description="$t('village.about.build')" />
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]"> <div class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_18rem]">
<VillageBuildForm <VillageBuildForm
:options="village.buildable" :options="village.buildable"
:buildings="village.buildings" :buildings="village.buildings"

View File

@ -8,9 +8,11 @@ const resources = computed(() => v.resources.value!)
const base = `/village/${route.params.id}` const base = `/village/${route.params.id}`
const { t } = useI18n() const { t } = useI18n()
/** Building picked in the village (by id), or an empty plot (by type); `?b=` opens one. */ // The village itself fills the screen behind (GameVillageFrame); here is only the card of
const selected = ref<number | null>(Number(route.query.b) || null) // what is picked in it, shown in the window. `?b=` opens a building's card.
const plot = ref<BuildingType | null>(null) const { selected, plot } = useVillageSelection()
if (Number(route.query.b)) selected.value = Number(route.query.b)
const selectedBuilding = computed(() => village.value.buildings.find((b) => b.id === selected.value) ?? null) const selectedBuilding = computed(() => village.value.buildings.find((b) => b.id === selected.value) ?? null)
const plotOption = computed(() => village.value.buildable.find((o) => o.type === plot.value) ?? null) const plotOption = computed(() => village.value.buildable.find((o) => o.type === plot.value) ?? null)
watch(selectedBuilding, (b) => { watch(selectedBuilding, (b) => {
@ -35,46 +37,28 @@ async function build(type: BuildingType) {
} }
</script> </script>
<!-- The village overview, laid out like Die Stämme's: the village, and a narrow column beside it. -->
<template> <template>
<div class="lg:grid lg:grid-cols-[minmax(0,1fr)_15rem]"> <VillageBuildingCard
<div class="relative"> v-if="selectedBuilding"
<div class="h-[clamp(260px,82vw,440px)] sm:h-[520px] lg:h-full lg:min-h-[520px]"> :building="selectedBuilding"
<VillageDiorama v-model:selected="selected" v-model:plot="plot" :village="village" :seconds-until="v.secondsUntil" /> :resources="resources"
</div> :can-afford="v.canAfford"
:busy="v.busy.value"
<VillageBuildingCard :link="screenLink"
v-if="selectedBuilding" @upgrade="v.upgrade"
class="m-2 lg:absolute lg:top-2 lg:right-2 lg:z-10 lg:m-0 lg:w-72" @demolish="v.demolish"
:building="selectedBuilding" @priority="v.setPriority"
:resources="resources" @close="selected = null"
:can-afford="v.canAfford" />
:busy="v.busy.value" <VillagePlotCard
:link="screenLink" v-else-if="plotOption"
@upgrade="v.upgrade" :option="plotOption"
@demolish="v.demolish" :resources="resources"
@priority="v.setPriority" :can-afford="v.canAfford"
@close="selected = null" :busy="v.busy.value"
/> :another="village.buildings.some((b) => b.type === plotOption!.type)"
<VillagePlotCard :all-link="`${base}/build`"
v-else-if="plotOption" @build="build"
class="m-2 lg:absolute lg:top-2 lg:right-2 lg:z-10 lg:m-0 lg:w-72" @close="plot = null"
:option="plotOption" />
:resources="resources"
:can-afford="v.canAfford"
:busy="v.busy.value"
:another="village.buildings.some((b) => b.type === plotOption!.type)"
:all-link="`${base}/build`"
@build="build"
@close="plot = null"
/>
</div>
<VillageOverviewSidebar
class="border-t-2 border-wood-700 lg:border-t-0 lg:border-l-2"
:village="village"
:base="base"
:seconds-until="v.secondsUntil"
/>
</div>
</template> </template>

View File

@ -32,7 +32,7 @@ const home = computed(() => unitRows(village.value.troops))
<VillageScreenHeader type="rally_point" :level="rallyPoint?.level ?? null" :title="$t('buildings.rally_point')" :description="$t('village.about.rally')" /> <VillageScreenHeader type="rally_point" :level="rallyPoint?.level ?? null" :title="$t('buildings.rally_point')" :description="$t('village.about.rally')" />
<UiSubTabs v-model="tab" :tabs="tabs" /> <UiSubTabs v-model="tab" :tabs="tabs" />
<div v-if="tab === 'commands'" class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]"> <div v-if="tab === 'commands'" class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,1fr)]">
<VillageSendTroops <VillageSendTroops
:key="`${route.query.x}|${route.query.y}`" :key="`${route.query.x}|${route.query.y}`"
class="self-start" class="self-start"
@ -54,7 +54,7 @@ const home = computed(() => unitRows(village.value.troops))
/> />
</div> </div>
<div v-else-if="tab === 'troops'" class="grid gap-3 lg:grid-cols-[18rem_minmax(0,1fr)]"> <div v-else-if="tab === 'troops'" class="grid gap-3 @4xl:grid-cols-[18rem_minmax(0,1fr)]">
<section class="panel self-start"> <section class="panel self-start">
<div class="panel-head"> <div class="panel-head">
<h2 class="panel-title">{{ $t('village.rally.at_home') }}</h2> <h2 class="panel-title">{{ $t('village.rally.at_home') }}</h2>

View File

@ -22,7 +22,7 @@ const shown = computed(() => village.value.military.find((m) => m.building_id ==
:title="shown ? $t(`buildings.${shown.type}`) : $t('village.screens.recruit')" :title="shown ? $t(`buildings.${shown.type}`) : $t('village.screens.recruit')"
:description="$t('village.about.recruit')" :description="$t('village.about.recruit')"
/> />
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]"> <div class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_18rem]">
<VillageRecruit <VillageRecruit
v-if="village.military.length" v-if="village.military.length"
v-model:selected="recruitAt" v-model:selected="recruitAt"

View File

@ -12,7 +12,7 @@ const showInVillage = (id: number) => navigateTo({ path: `/village/${route.param
<template> <template>
<div class="space-y-3 p-2.5"> <div class="space-y-3 p-2.5">
<VillageScreenHeader type="farm" :level="farm?.level ?? null" :title="$t('village.screens.workforce')" :description="$t('village.about.workforce')" /> <VillageScreenHeader type="farm" :level="farm?.level ?? null" :title="$t('village.screens.workforce')" :description="$t('village.about.workforce')" />
<div class="grid gap-3 lg:grid-cols-[minmax(0,1fr)_18rem]"> <div class="grid gap-3 @4xl:grid-cols-[minmax(0,1fr)_18rem]">
<VillageBuildingTable :buildings="village.buildings" :busy="v.busy.value" @select="showInVillage" @priority="v.setPriority" /> <VillageBuildingTable :buildings="village.buildings" :busy="v.busy.value" @select="showInVillage" @priority="v.setPriority" />
<VillagePopulationPanel :population="village.population" :militia="village.levy.militia" /> <VillagePopulationPanel :population="village.population" :militia="village.levy.militia" />
</div> </div>

View File

@ -60,6 +60,7 @@ export default {
nobleman: 'Nobleman', nobleman: 'Nobleman',
militia: 'Militia', militia: 'Militia',
}, },
window: { fold: 'Fold', unfold: 'Unfold', close: 'Close' },
errors: { errors: {
unknown: 'Something went wrong.', unknown: 'Something went wrong.',
unauthenticated: 'Please log in again.', unauthenticated: 'Please log in again.',