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
|
|
|
<script setup lang="ts">
|
2026-10-30 10:17:34 +00:00
|
|
|
import type { MapMovement, MapVillage } from '~/types/map'
|
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
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
|
village: MapVillage
|
|
|
|
|
/** The player's village the bar shows, for distance and sending troops. */
|
|
|
|
|
from: { id: number; x: number; y: number } | null
|
|
|
|
|
/** With actions (a click), or just the facts (hovering). */
|
|
|
|
|
actions?: boolean
|
2026-10-30 10:17:34 +00:00
|
|
|
/** Groups on the map, for those leaving or coming to the village (on a click). */
|
|
|
|
|
movements?: MapMovement[]
|
|
|
|
|
now?: number
|
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
|
|
|
}>()
|
2026-10-30 10:17:34 +00:00
|
|
|
const emit = defineEmits<{ center: []; close: []; march: [id: number] }>()
|
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
|
|
|
|
|
|
|
|
const distance = computed(() => (props.from ? Math.hypot(props.village.x - props.from.x, props.village.y - props.from.y) : null))
|
|
|
|
|
const own = computed(() => props.village.own)
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<!-- A village on the map up close: who it belongs to, its points and distance; on a click, what to do with it. -->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="w-60 rounded-sm border-2 border-wood-950 bg-parchment-50 text-sm text-ink-900 shadow-hard">
|
|
|
|
|
<div class="flex items-start gap-2 border-b border-wood-700 bg-parchment-200 px-3 py-1.5">
|
|
|
|
|
<div class="min-w-0 flex-1">
|
|
|
|
|
<p class="truncate font-semibold">{{ village.name }}</p>
|
|
|
|
|
<p class="text-xs text-ink-500 tabular-nums">{{ village.x }}|{{ village.y }} {{ village.continent }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
<button v-if="actions" type="button" class="text-ink-500 hover:text-blood-700" :aria-label="$t('common.close')" @click="emit('close')">
|
|
|
|
|
<IconUi name="close" class="size-4" />
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
<dl class="grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 px-3 py-1.5 text-xs">
|
|
|
|
|
<dt class="text-ink-500">{{ $t('map.info.owner') }}</dt>
|
|
|
|
|
<dd class="truncate">{{ village.player?.name ?? $t('map.barbarian') }}</dd>
|
|
|
|
|
<dt class="text-ink-500">{{ $t('map.info.points') }}</dt>
|
|
|
|
|
<dd class="tabular-nums">{{ village.points }}</dd>
|
|
|
|
|
<template v-if="distance !== null && distance > 0">
|
|
|
|
|
<dt class="text-ink-500">{{ $t('village.rally.distance') }}</dt>
|
|
|
|
|
<dd class="tabular-nums">{{ $t('village.rally.fields', { fields: distance.toFixed(1) }) }}</dd>
|
|
|
|
|
</template>
|
|
|
|
|
</dl>
|
2026-10-30 10:17:34 +00:00
|
|
|
<MapMarchList
|
|
|
|
|
v-if="actions && movements && now"
|
|
|
|
|
class="border-t border-parchment-300 px-3 py-1.5 text-xs"
|
|
|
|
|
:village-id="village.id"
|
|
|
|
|
:movements="movements"
|
|
|
|
|
:now="now"
|
|
|
|
|
@march="emit('march', $event)"
|
|
|
|
|
/>
|
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
|
|
|
<div v-if="actions" class="flex flex-wrap gap-1.5 border-t border-parchment-300 px-3 py-2">
|
|
|
|
|
<NuxtLink
|
|
|
|
|
v-if="from && from.id !== village.id"
|
|
|
|
|
:to="{ path: `/village/${from.id}/rally`, query: { x: village.x, y: village.y } }"
|
2026-10-29 00:26:08 +00:00
|
|
|
class="btn btn-attack"
|
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
|
|
|
>
|
|
|
|
|
<IconUi name="attack" class="size-3.5" />
|
|
|
|
|
{{ $t('map.info.send') }}
|
|
|
|
|
</NuxtLink>
|
|
|
|
|
<NuxtLink v-if="own" :to="`/village/${village.id}`" class="btn btn-outline px-2 py-1 text-xs">{{ $t('map.info.open') }}</NuxtLink>
|
|
|
|
|
<button type="button" class="btn btn-outline px-2 py-1 text-xs" @click="emit('center')">{{ $t('map.info.center') }}</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|