2026-10-28 18:58:42 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import type { MapVillage } from '~/types/map'
|
|
|
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
|
village: MapVillage | null
|
|
|
|
|
at: { x: number; y: number } | null
|
|
|
|
|
}>()
|
|
|
|
|
const emit = defineEmits<{ center: [at: { x: number; y: number }] }>()
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
const { current } = useCurrentWorld()
|
2026-10-28 18:58:42 +00:00
|
|
|
|
|
|
|
|
const continentOf = (x: number, y: number) => `K${Math.floor(y / 100)}${Math.floor(x / 100)}`
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<section class="panel">
|
|
|
|
|
<div class="panel-head">
|
|
|
|
|
<h2 class="panel-title">{{ $t('map.info.title') }}</h2>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="panel-body text-sm">
|
|
|
|
|
<template v-if="village">
|
|
|
|
|
<p class="font-display text-lg font-semibold">{{ village.name }}</p>
|
|
|
|
|
<dl class="mt-3 grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5">
|
|
|
|
|
<dt class="text-ink-500">{{ $t('map.info.coordinates') }}</dt>
|
|
|
|
|
<dd class="font-semibold tabular-nums">{{ village.x }}|{{ village.y }} <span class="text-ink-500">{{ village.continent }}</span></dd>
|
|
|
|
|
<dt class="text-ink-500">{{ $t('map.info.owner') }}</dt>
|
|
|
|
|
<dd>{{ village.player?.name ?? $t('map.barbarian') }}</dd>
|
|
|
|
|
<dt class="text-ink-500">{{ $t('map.info.points') }}</dt>
|
|
|
|
|
<dd class="tabular-nums">{{ village.points }}</dd>
|
|
|
|
|
</dl>
|
|
|
|
|
<div class="mt-4 flex flex-wrap gap-2">
|
|
|
|
|
<NuxtLink v-if="village.own" :to="`/village/${village.id}`" class="btn btn-primary">{{ $t('map.info.open') }}</NuxtLink>
|
feat: rally point, troop movements, support, reports, scouts, battle simulator and village rename
Send attacks and support from the rally point with a live travel-time preview, see own
commands and spotted incoming attacks with countdowns and call-back, send support home
or withdraw it, read battle and support reports with an unread badge, run the battle
simulator, rename villages, and send troops straight from the map. The watchtower gets
a diorama model; the mock server answers every new intent.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 23:16:06 +00:00
|
|
|
<NuxtLink
|
|
|
|
|
v-if="current?.villageId && current.villageId !== village.id"
|
|
|
|
|
:to="{ path: `/village/${current.villageId}/rally`, query: { x: village.x, y: village.y } }"
|
|
|
|
|
class="btn btn-outline"
|
|
|
|
|
>
|
|
|
|
|
<IconUi name="attack" class="size-4" />
|
|
|
|
|
{{ $t('map.info.send') }}
|
|
|
|
|
</NuxtLink>
|
2026-10-28 18:58:42 +00:00
|
|
|
<button type="button" class="btn btn-outline" @click="emit('center', { x: village.x, y: village.y })">
|
|
|
|
|
{{ $t('map.info.center') }}
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else-if="at">
|
|
|
|
|
<p class="text-ink-700">{{ $t('map.info.empty') }}</p>
|
|
|
|
|
<p class="mt-1 font-semibold tabular-nums">{{ at.x }}|{{ at.y }} <span class="text-ink-500">{{ continentOf(at.x, at.y) }}</span></p>
|
|
|
|
|
</template>
|
|
|
|
|
<p v-else class="text-ink-500">{{ $t('map.info.hint') }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
</template>
|