2026-11-03 09:17:53 +00:00
|
|
|
<script setup lang="ts">
|
2026-11-03 09:59:27 +00:00
|
|
|
import { MAP_LOOKS } from '~/diorama/mapTiles'
|
|
|
|
|
|
|
|
|
|
// Every village look once, for <use> on the map: the picture of its demo village (painted
|
|
|
|
|
// once per session, useMapTiles), and its marker at the field's top-left in the relation
|
|
|
|
|
// colour (currentColor, set on each <use>): a flag for a player's village, a dot for a
|
|
|
|
|
// barbarian's, the gold crown on a crown fort. A second layout shows the first until it is
|
|
|
|
|
// painted; before any, a bare clearing.
|
|
|
|
|
const urls = useMapTiles()
|
|
|
|
|
const href = (id: string) => urls[id] ?? urls[id.replace(/-1$/, '-0')]
|
|
|
|
|
const looks = MAP_LOOKS.map((l) => ({ id: l.id, crown: l.tier === 'crown', dot: l.worn }))
|
2026-11-03 09:17:53 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-11-03 09:59:27 +00:00
|
|
|
<symbol v-for="l in looks" :id="l.id" :key="l.id" viewBox="0 0 100 100" overflow="visible">
|
|
|
|
|
<image v-if="href(l.id)" :href="href(l.id)" width="100" height="100" />
|
|
|
|
|
<g v-else>
|
|
|
|
|
<ellipse cx="50" cy="60" rx="40" ry="19" fill="#6c6f48" />
|
|
|
|
|
<ellipse cx="50" cy="60" rx="34" ry="16" fill="#6d6b48" />
|
|
|
|
|
<ellipse cx="50" cy="60" rx="29" ry="13" fill="#6d6748" />
|
|
|
|
|
</g>
|
|
|
|
|
<circle v-if="l.dot" cx="10" cy="10" r="5" fill="currentColor" stroke="#2b2118" stroke-width="1.4" />
|
|
|
|
|
<g v-else>
|
|
|
|
|
<rect x="5.5" y="3" width="2.4" height="25" fill="#2b2118" />
|
|
|
|
|
<polygon points="7.9,3.5 26,9.5 7.9,15.5" fill="currentColor" stroke="#2b2118" stroke-width="1.4" stroke-linejoin="round" />
|
|
|
|
|
</g>
|
|
|
|
|
<g v-if="l.crown">
|
|
|
|
|
<polygon points="78,14 78,4 82.5,8.5 87,2 91.5,8.5 96,4 96,14" fill="#d9b44a" stroke="#6b4f16" stroke-width="1" stroke-linejoin="round" />
|
|
|
|
|
<rect x="78" y="11" width="18" height="3" fill="#a8842e" />
|
|
|
|
|
</g>
|
2026-11-03 09:17:53 +00:00
|
|
|
</symbol>
|
|
|
|
|
</template>
|