Make dead and temporarily blocked tiles easier to recognize
This commit is contained in:
parent
d60fbab2ee
commit
cfff677295
24 changed files with 196 additions and 15 deletions
|
|
@ -1,10 +1,15 @@
|
|||
# Acquire private beta — 23 October 2026
|
||||
|
||||
Private BGS registration: `acquire`, version `1`. Engine `0.0.2`, viewer `0.0.12`.
|
||||
Private BGS registration: `acquire`, version `1`. Engine `0.0.2`, viewer `0.0.13`.
|
||||
Source: <https://github.com/boardgamers/mergers-game>. Keep `public: false`.
|
||||
|
||||
## Validation
|
||||
|
||||
- Dead hand tiles use hatching and a prohibition symbol with a readable coordinate. A compact
|
||||
note explains replacement at turn end; temporary blocks use a separate pause symbol and reason.
|
||||
Dead board markers use the same hatching. Browser checks cover equal tile heights, both themes,
|
||||
all 17 languages and desktop/390/320-pixel widths.
|
||||
|
||||
- Merger disposal shows the surviving chain's price after this merger before players sell or trade.
|
||||
Verified the reported Festival (3) / Imperial (3) case: Imperial grows from $500 to $800 at
|
||||
7 tiles, while Festival sales remain $400 each. Preview checks include connected loose tiles,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "acquire-viewer",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.13",
|
||||
"private": true,
|
||||
"description": "Browser viewer for Acquire on boardgamers.space",
|
||||
"license": "AGPL-3.0-only",
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@
|
|||
instead of letting chat and history make one very tall sidebar. */
|
||||
@media (min-width: 1200px) {
|
||||
.layout {
|
||||
row-gap: 16px;
|
||||
grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr) minmax(320px, 1fr);
|
||||
grid-template-areas:
|
||||
"board controls market"
|
||||
|
|
|
|||
|
|
@ -74,7 +74,14 @@
|
|||
class="square empty"
|
||||
class:held={held.has(tile)}
|
||||
class:unavailable={legality !== undefined && legality !== "playable"}
|
||||
aria-label={held.has(tile) ? `${label} — ${t("hand.yours")}` : t("board.empty", { tile: label })}
|
||||
class:dead={legality === "permanentlyUnplayable"}
|
||||
aria-label={legality === "permanentlyUnplayable"
|
||||
? `${label} — ${t("hand.dead")}`
|
||||
: legality === "temporarilyUnplayable"
|
||||
? `${label} — ${t("hand.eighth")}`
|
||||
: held.has(tile)
|
||||
? `${label} — ${t("hand.yours")}`
|
||||
: t("board.empty", { tile: label })}
|
||||
title={legality === "permanentlyUnplayable"
|
||||
? t("hand.dead")
|
||||
: legality === "temporarilyUnplayable"
|
||||
|
|
@ -178,7 +185,14 @@
|
|||
}
|
||||
.empty.unavailable .coord {
|
||||
color: var(--on-empty);
|
||||
text-decoration: line-through;
|
||||
background: var(--empty);
|
||||
}
|
||||
.empty.dead {
|
||||
background-image: repeating-linear-gradient(
|
||||
135deg,
|
||||
transparent 0 5px,
|
||||
color-mix(in srgb, var(--on-empty) 18%, transparent) 5px 7px
|
||||
);
|
||||
}
|
||||
.empty.selected {
|
||||
background: var(--page);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
import { ofType } from "./decisions";
|
||||
import { seatName } from "./format";
|
||||
import type { ViewerStore } from "./store.svelte";
|
||||
import TileStatusIcon from "./TileStatusIcon.svelte";
|
||||
|
||||
let { store }: { store: ViewerStore } = $props();
|
||||
const t = $derived(store.lang.t);
|
||||
|
|
@ -14,7 +15,7 @@
|
|||
function why(tile: Tile): string {
|
||||
const legality = tileLegality(state.board, tile);
|
||||
if (legality === "permanentlyUnplayable") {
|
||||
return t("hand.dead");
|
||||
return `${t("hand.dead")}. ${t("hand.deadReplacement")}.`;
|
||||
}
|
||||
if (legality === "temporarilyUnplayable") {
|
||||
return t("hand.eighth");
|
||||
|
|
@ -30,10 +31,14 @@
|
|||
{#each store.seats as seat (seat)}
|
||||
<!-- Masked tiles can only appear while a new seat's state is still arriving; never show them. -->
|
||||
{@const hand = sortTiles(state.seats[seat]!.hand.filter((tile) => tile !== HIDDEN))}
|
||||
{@const dead = hand.filter((tile) => tileLegality(state.board, tile) === "permanentlyUnplayable")}
|
||||
{@const paused = hand.filter((tile) => tileLegality(state.board, tile) === "temporarilyUnplayable")}
|
||||
<section class="hand" aria-label={t("hand.of", { name: seatName(state, seat, store.lang) })}>
|
||||
<h2>{store.seats.length > 1 ? t("hand.seat", { seat: seat + 1 }) : t("hand.yours")}</h2>
|
||||
<div class="tiles">
|
||||
{#each hand as tile, index (index)}
|
||||
{@const permanent = dead.includes(tile)}
|
||||
{@const blocked = permanent || paused.includes(tile)}
|
||||
{#if playable.has(tile)}
|
||||
<button
|
||||
type="button"
|
||||
|
|
@ -45,15 +50,38 @@
|
|||
onclick={() => choose(tile)}>{tileLabel(tile)}</button
|
||||
>
|
||||
{:else}
|
||||
<span class="tile" title={why(tile)}>
|
||||
{tileLabel(tile)}
|
||||
{#if why(tile)}<small>{why(tile)}</small>{/if}
|
||||
<span
|
||||
class="tile"
|
||||
class:dead={permanent}
|
||||
class:paused={paused.includes(tile)}
|
||||
title={why(tile)}
|
||||
role="img"
|
||||
aria-label={blocked ? `${tileLabel(tile)} — ${why(tile)}` : tileLabel(tile)}
|
||||
>
|
||||
<span class="coordinate">{tileLabel(tile)}</span>
|
||||
{#if blocked}<span class="tile-status"><TileStatusIcon {permanent} /></span>{/if}
|
||||
</span>
|
||||
{/if}
|
||||
{:else}
|
||||
<span class="none">{t("hand.none")}</span>
|
||||
{/each}
|
||||
</div>
|
||||
{#if dead.length || paused.length}
|
||||
<ul class="tile-notes">
|
||||
{#if dead.length}
|
||||
<li class="dead-note">
|
||||
<TileStatusIcon permanent={true} />
|
||||
<span><bdi>{dead.map(tileLabel).join(", ")}</bdi> — {t("hand.deadReplacement")}</span>
|
||||
</li>
|
||||
{/if}
|
||||
{#if paused.length}
|
||||
<li class="paused-note">
|
||||
<TileStatusIcon permanent={false} />
|
||||
<span><bdi>{paused.map(tileLabel).join(", ")}</bdi> — {t("hand.eighth")}</span>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
{/if}
|
||||
</section>
|
||||
{/each}
|
||||
|
||||
|
|
@ -61,6 +89,9 @@
|
|||
.hand {
|
||||
margin: 12px 0 0;
|
||||
}
|
||||
.hand:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
/* Six tiles fit on one row; the 12px gaps leave room for outlines drawn outside the tiles. */
|
||||
.tiles {
|
||||
display: grid;
|
||||
|
|
@ -97,13 +128,42 @@
|
|||
.tile.actionable.selected {
|
||||
outline: 4px solid var(--accent);
|
||||
}
|
||||
.tile small {
|
||||
font-size: 9px;
|
||||
font-weight: 400;
|
||||
line-height: 1.1;
|
||||
text-align: center;
|
||||
padding: 0 2px;
|
||||
color: var(--on-loose);
|
||||
.tile.dead,
|
||||
.tile.paused {
|
||||
gap: 3px;
|
||||
color: color-mix(in srgb, var(--on-loose) 76%, var(--loose));
|
||||
}
|
||||
.tile.dead {
|
||||
background-image: repeating-linear-gradient(135deg, transparent 0 5px, #ffffff14 5px 7px);
|
||||
}
|
||||
.dead .coordinate {
|
||||
background: var(--loose);
|
||||
padding: 0 3px;
|
||||
}
|
||||
.tile-status {
|
||||
display: flex;
|
||||
background: var(--loose);
|
||||
}
|
||||
.tile-notes {
|
||||
list-style: none;
|
||||
margin: 4px 0 0;
|
||||
padding: 0;
|
||||
max-width: 388px;
|
||||
font-size: 12px;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
.tile-notes li {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
gap: 6px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.tile-notes :global(svg) {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.tile-notes bdi {
|
||||
font-weight: 600;
|
||||
color: var(--ink);
|
||||
}
|
||||
.none {
|
||||
color: var(--ink-muted);
|
||||
|
|
|
|||
20
packages/viewer/src/lib/TileStatusIcon.svelte
Normal file
20
packages/viewer/src/lib/TileStatusIcon.svelte
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<script lang="ts">
|
||||
let { permanent, size = 16 }: { permanent: boolean; size?: number } = $props();
|
||||
</script>
|
||||
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox="0 0 20 20"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="1.7"
|
||||
aria-hidden="true"
|
||||
>
|
||||
{#if permanent}
|
||||
<circle cx="10" cy="10" r="7" />
|
||||
<path d="m5 5 10 10" />
|
||||
{:else}
|
||||
<path d="M7 4v12M13 4v12" stroke-width="3" />
|
||||
{/if}
|
||||
</svg>
|
||||
|
|
@ -70,6 +70,7 @@ export const da: Catalog = {
|
|||
"hand.of": "{name}s brikker",
|
||||
"hand.none": "Ingen brikker",
|
||||
"hand.dead": "død: ville fusionere sikre kæder",
|
||||
"hand.deadReplacement": "Udskiftes ved slutningen af din tur",
|
||||
"hand.eighth": "kan ikke grundlægge en 8. kæde",
|
||||
"chains.label": "Hotelkæder",
|
||||
"chains.title": "Kæder",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const de: Catalog = {
|
|||
"hand.of": "Plättchen von {name}",
|
||||
"hand.none": "Keine Plättchen",
|
||||
"hand.dead": "tot: würde sichere Ketten fusionieren",
|
||||
"hand.deadReplacement": "Werden am Ende deines Zuges ersetzt",
|
||||
"hand.eighth": "keine 8. Kette möglich",
|
||||
"chains.label": "Hotelketten",
|
||||
"chains.title": "Ketten",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const el: Catalog = {
|
|||
"hand.of": "Πλακίδια του/της {name}",
|
||||
"hand.none": "Κανένα πλακίδιο",
|
||||
"hand.dead": "νεκρό: θα συγχώνευε ασφαλείς αλυσίδες",
|
||||
"hand.deadReplacement": "Αντικατάσταση στο τέλος του γύρου σου",
|
||||
"hand.eighth": "δεν ιδρύεται 8η αλυσίδα",
|
||||
"chains.label": "Αλυσίδες ξενοδοχείων",
|
||||
"chains.title": "Αλυσίδες",
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ export const en = {
|
|||
"hand.of": "Tiles of {name}",
|
||||
"hand.none": "No tiles",
|
||||
"hand.dead": "dead: would merge safe chains",
|
||||
"hand.deadReplacement": "Replaced at the end of your turn",
|
||||
"hand.eighth": "can't found an 8th chain",
|
||||
|
||||
// Chain and price tables
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const fa: Catalog = {
|
|||
"hand.of": "کاشیهای {name}",
|
||||
"hand.none": "بدون کاشی",
|
||||
"hand.dead": "مرده: زنجیرههای امن را ادغام میکند",
|
||||
"hand.deadReplacement": "در پایان نوبت شما جایگزین میشوند",
|
||||
"hand.eighth": "زنجیرهی هشتم ممکن نیست",
|
||||
"chains.label": "زنجیرههای هتل",
|
||||
"chains.title": "زنجیرهها",
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export const fr: Catalog = {
|
|||
"hand.of": "Tuiles de {name}",
|
||||
"hand.none": "Aucune tuile",
|
||||
"hand.dead": "morte : fusionnerait des chaînes sûres",
|
||||
"hand.deadReplacement": "Remplacement à la fin de votre tour",
|
||||
"hand.eighth": "impossible de fonder une 8e chaîne",
|
||||
"chains.label": "Chaînes d’hôtels",
|
||||
"chains.title": "Chaînes",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export const hi: Catalog = {
|
|||
"hand.of": "{name} की टाइलें",
|
||||
"hand.none": "कोई टाइल नहीं",
|
||||
"hand.dead": "बेकार: सुरक्षित श्रृंखलाओं का विलय कर देगी",
|
||||
"hand.deadReplacement": "आपकी बारी के अंत में बदल दी जाएँगी",
|
||||
"hand.eighth": "8वीं श्रृंखला स्थापित नहीं हो सकती",
|
||||
"chains.label": "होटल श्रृंखलाएँ",
|
||||
"chains.title": "श्रृंखलाएँ",
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export const it: Catalog = {
|
|||
"hand.of": "Tessere di {name}",
|
||||
"hand.none": "Nessuna tessera",
|
||||
"hand.dead": "morta: fonderebbe catene sicure",
|
||||
"hand.deadReplacement": "Sostituite alla fine del tuo turno",
|
||||
"hand.eighth": "non si può fondare un'8ª catena",
|
||||
"chains.label": "Catene alberghiere",
|
||||
"chains.title": "Catene",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const ko: Catalog = {
|
|||
"hand.of": "{name}의 타일",
|
||||
"hand.none": "타일 없음",
|
||||
"hand.dead": "죽은 타일: 안전한 체인끼리 합병하게 됨",
|
||||
"hand.deadReplacement": "내 차례가 끝나면 교체됩니다",
|
||||
"hand.eighth": "8번째 체인은 세울 수 없음",
|
||||
"chains.label": "호텔 체인",
|
||||
"chains.title": "체인",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const nl: Catalog = {
|
|||
"hand.of": "Tegels van {name}",
|
||||
"hand.none": "Geen tegels",
|
||||
"hand.dead": "dood: zou veilige ketens fuseren",
|
||||
"hand.deadReplacement": "Worden aan het einde van je beurt vervangen",
|
||||
"hand.eighth": "kan geen 8e keten stichten",
|
||||
"chains.label": "Hotelketens",
|
||||
"chains.title": "Ketens",
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ export const pl: Catalog = {
|
|||
"hand.of": "Płytki gracza {name}",
|
||||
"hand.none": "Brak płytek",
|
||||
"hand.dead": "martwa: połączyłaby bezpieczne sieci",
|
||||
"hand.deadReplacement": "Wymiana na koniec twojej tury",
|
||||
"hand.eighth": "nie można założyć 8. sieci",
|
||||
"chains.label": "Sieci hoteli",
|
||||
"chains.title": "Sieci",
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export const ptBR: Catalog = {
|
|||
"hand.of": "Peças de {name}",
|
||||
"hand.none": "Nenhuma peça",
|
||||
"hand.dead": "morta: fundiria redes seguras",
|
||||
"hand.deadReplacement": "Substituição no fim do seu turno",
|
||||
"hand.eighth": "não dá para fundar uma 8ª rede",
|
||||
"chains.label": "Redes de hotéis",
|
||||
"chains.title": "Redes",
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ export const ro: Catalog = {
|
|||
"hand.of": "Piesele lui {name}",
|
||||
"hand.none": "Nicio piesă",
|
||||
"hand.dead": "moartă: ar uni lanțuri sigure",
|
||||
"hand.deadReplacement": "Înlocuire la sfârșitul turei tale",
|
||||
"hand.eighth": "nu se poate înființa un al 8-lea lanț",
|
||||
"chains.label": "Lanțuri hoteliere",
|
||||
"chains.title": "Lanțuri",
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ export const ru: Catalog = {
|
|||
"hand.of": "Фишки игрока {name}",
|
||||
"hand.none": "Нет фишек",
|
||||
"hand.dead": "мёртвая: слила бы защищённые сети",
|
||||
"hand.deadReplacement": "Заменяются в конце вашего хода",
|
||||
"hand.eighth": "нельзя основать 8-ю сеть",
|
||||
"chains.label": "Гостиничные сети",
|
||||
"chains.title": "Сети",
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ export const vi: Catalog = {
|
|||
"hand.of": "Ô của {name}",
|
||||
"hand.none": "Không có ô",
|
||||
"hand.dead": "ô chết: sẽ sáp nhập các chuỗi an toàn",
|
||||
"hand.deadReplacement": "Được thay khi kết thúc lượt của bạn",
|
||||
"hand.eighth": "không thể lập chuỗi thứ 8",
|
||||
"chains.label": "Chuỗi khách sạn",
|
||||
"chains.title": "Chuỗi",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export const zhCN: Catalog = {
|
|||
"hand.of": "{name} 的板块",
|
||||
"hand.none": "没有板块",
|
||||
"hand.dead": "死板块:会合并安全连锁",
|
||||
"hand.deadReplacement": "在你的回合结束时更换",
|
||||
"hand.eighth": "无法创立第 8 个连锁",
|
||||
"chains.label": "酒店连锁",
|
||||
"chains.title": "连锁",
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ export const zhTW: Catalog = {
|
|||
"hand.of": "{name} 的板塊",
|
||||
"hand.none": "沒有板塊",
|
||||
"hand.dead": "死板塊:會合併安全連鎖",
|
||||
"hand.deadReplacement": "在你的回合結束時更換",
|
||||
"hand.eighth": "無法創立第 8 個連鎖",
|
||||
"chains.label": "飯店連鎖",
|
||||
"chains.title": "連鎖",
|
||||
|
|
|
|||
|
|
@ -145,6 +145,70 @@ try {
|
|||
"post-merger price visible before trading; original sale price unchanged; all 17 locales at desktop, phone and 320px"
|
||||
);
|
||||
|
||||
for (const width of [1280, 390, 320]) {
|
||||
await page.setViewportSize({ width, height: 900 });
|
||||
await open("players=3&theme=dark");
|
||||
await page.evaluate((state) => {
|
||||
const { parseTile, allTiles } = window.acquireDev.rules;
|
||||
state.board.fill(null);
|
||||
const fill = (chain, labels) => labels.forEach((label) => (state.board[parseTile(label)] = chain));
|
||||
fill("tower", [...Array.from({ length: 9 }, (_, i) => `${i + 1}C`), "4B", "5B"]);
|
||||
fill(
|
||||
"luxor",
|
||||
Array.from({ length: 11 }, (_, i) => `${i + 1}E`)
|
||||
);
|
||||
fill("worldwide", ["1G", "2G"]);
|
||||
fill("american", ["4G", "5G"]);
|
||||
fill("festival", ["7G", "8G"]);
|
||||
fill("imperial", ["10G", "11G"]);
|
||||
fill("continental", ["1I", "2I"]);
|
||||
fill("loose", ["12H"]);
|
||||
state.seats[0].hand = ["2B", "3B", "5D", "6I", "10D", "12I"].map(parseTile);
|
||||
const remaining = allTiles().filter((tile) => state.board[tile] === null && !state.seats[0].hand.includes(tile));
|
||||
for (const seat of state.seats.slice(1)) {
|
||||
seat.hand = remaining.splice(0, 6);
|
||||
}
|
||||
state.pool = remaining;
|
||||
window.acquireDev.load(state);
|
||||
}, preparedPosition("mergers"));
|
||||
await page.waitForSelector(".hand .tile.dead");
|
||||
assert.equal(await page.locator(".hand .tile.dead .coordinate").innerText(), "5D");
|
||||
assert.equal(await page.locator(".hand .tile.paused .coordinate").innerText(), "12I");
|
||||
assert.equal(await page.locator(".hand .tile small").count(), 0);
|
||||
assert.match(await page.locator(".dead-note").innerText(), /5D.*Replaced at the end of your turn/);
|
||||
assert.match(await page.locator(".paused-note").innerText(), /12I.*can't found an 8th chain/);
|
||||
assert.match(await page.locator(".square.dead").getAttribute("aria-label"), /5D.*would merge safe chains/);
|
||||
assert.equal(await page.locator("button.tile.dead, button.tile.paused, button.square.dead").count(), 0);
|
||||
for (const theme of ["dark", "light"]) {
|
||||
await page.evaluate((theme) => window.acquireDev.emitter.emit("theme", { dark: theme === "dark" }), theme);
|
||||
for (const locale of locales) {
|
||||
await preferences({ locale });
|
||||
assert.ok(
|
||||
await page.evaluate(() => {
|
||||
const tiles = [...document.querySelectorAll(".hand .tile")];
|
||||
const height = tiles[0].getBoundingClientRect().height;
|
||||
return (
|
||||
document.documentElement.scrollWidth <= innerWidth + 1 &&
|
||||
tiles.every(
|
||||
(tile) =>
|
||||
Math.abs(tile.getBoundingClientRect().height - height) < 1 &&
|
||||
tile.scrollHeight <= tile.clientHeight + 1
|
||||
)
|
||||
);
|
||||
}),
|
||||
`dead/temporary tile ${locale} ${theme} ${width}px`
|
||||
);
|
||||
}
|
||||
await preferences({ locale: "en" });
|
||||
await page
|
||||
.locator("section.hand")
|
||||
.screenshot({ path: new URL(`dead-tiles-${theme}-${width}.png`, output).pathname });
|
||||
}
|
||||
}
|
||||
report.scenarios.push(
|
||||
"dead tiles and temporary blocks: distinct symbols, readable coordinates and notes, equal tile heights, all locales in both themes"
|
||||
);
|
||||
|
||||
for (const theme of ["light", "dark"]) {
|
||||
await page.setViewportSize({ width: 1920, height: 1280 });
|
||||
await open(`players=4&moves=95&publicHoldings=1&theme=${theme}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue