From d59999f337ad1d6277dd969e405c4639fda05aef Mon Sep 17 00:00:00 2001 From: coyotte508 Date: Tue, 29 Sep 2026 19:21:11 +0200 Subject: [PATCH] Show sand drawing capacity on island tiles --- viewer/board.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/viewer/board.js b/viewer/board.js index f6879bc..e314edb 100644 --- a/viewer/board.js +++ b/viewer/board.js @@ -49,14 +49,18 @@ function tileImage(spec, c, ghost = false, prefix = "board") { return `${ocean}${art}`; } function resourceBadge(x, y, items) { - const widths = items.map(({ value }) => 34 + String(value).length * 11); + const widths = items.map( + ({ value }) => + 30 + + [...String(value)].reduce((width, c) => width + (c === "/" ? 6 : 11), 0), + ); const width = widths.reduce((a, b) => a + b, 0) + 8; let offset = x - width / 2 + 4; return `${items .map(({ kind, value, help }, i) => { const left = offset; offset += widths[i]; - return `${esc(help)}${svgIcon(kind, left, y + 3, 24)}${esc(value)}`; + return `${esc(help)}${svgIcon(kind, left, y + 3, 24)}${esc(value)}`; }) .join("")}`; } @@ -166,10 +170,7 @@ export function boardSvg( }, { kind: "draw", - value: - preview || ghost - ? `${tile.drawings}/${spec.drawings}` - : tile.drawings, + value: `${tile.drawings}/${spec.drawings}`, help: `${label("draw")}: ${tile.drawings}/${spec.drawings}`, }, ]);