Click a map marker to see its art at full size

Reuses the lightbox already built for the character gallery. Clicking
any location still triggers the visit as before, but now also probes
for that location's art and, if it exists, pops it up full-size with
a caption — no modal for locations that don't have art yet, the visit
still happens either way.

Also added a standing "about this place" blurb per location (map.ts's
new LOCATION_INFO), shown under the art. This is distinct from
LOCATION_VISITS' randomized per-visit outcome text in engine.ts, which
still changes every time — the blurb is a fixed description of the
place itself, not what just happened there.

Verified via headless browser: clicking Turning Torso's marker pops
the lightbox with its real art, label, and blurb, no console errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-08-01 21:42:28 +02:00
parent d2a8b71ffc
commit 1aa9eb2ce8
5 changed files with 101 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
import './style.css';
import { createState, tick, buyUpgrade, visitLocation, resolveEventChoice, startGame, abandonGame, saveState, loadState, clearSave, applyOfflineProgress, VISITABLE_LOCATION_IDS } from './engine.ts';
import { initUI, renderState, setPausedUI } from './ui.ts';
import { initMap, updateMap } from './map.ts';
import { initUI, renderState, setPausedUI, showLocationArt } from './ui.ts';
import { initMap, updateMap, LOCATION_INFO } from './map.ts';
let state = loadState() ?? createState();
@@ -74,6 +74,9 @@ function start(): void {
state = result.state;
visitCooldowns = result.cooldowns;
renderState(state);
const info = LOCATION_INFO[locationId];
if (info) showLocationArt(locationId, info.label, info.blurb);
});
renderState(state);