diff --git a/docs/DESIGN.md b/docs/DESIGN.md index 023e4d5..f6d9182 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -252,6 +252,14 @@ above, including: career and come along; buildings stay on their claim and wait (they don't run) until you travel back from the notebook's Claims page. +- **A minimap and a full map (t32, 2026-10-24).** Bottom right: a minimap around the bot with + zoom (1 to 16 grains per pixel) and a Map button; M opens the full map (wheel zoom, drag to + pan, centre on bot, markers for the bot and the dock). Both draw from one low-resolution colour + image of the world (1 pixel per 2 grains, 4 on worlds wider than 4096) that refreshes a few + 32-grain areas a frame, nearest the bot first, and respects fog of war. Onboarding cards moved + to the bottom centre to make room; mute moved to Shift+M. Bigger worlds and several claims + made it easy to get lost. + - **Long waits show what's happening (t30, 2026-10-24).** Generating, loading, opening a claim and travelling show the loading overlay with a title, a moving bar and the current step ("Laying rock and ore", "Unpacking", "Building the world"...). Generation runs as steps that diff --git a/docs/PROJECT_MAP.md b/docs/PROJECT_MAP.md index 6e2c7cf..02cd6fd 100644 --- a/docs/PROJECT_MAP.md +++ b/docs/PROJECT_MAP.md @@ -390,7 +390,7 @@ Shared player state; the world save remains a complete standalone fallback. Starting, loading and quitting a game; modal dialogs; the pause menu. - functions: showLoading, enterGame, setupNewWorld, startNewWorld, startFromSave, loadSavedWorld, quitToTitle, refreshContinue, anyModal, openModal, closeModal, closeAllModals, topModal, dialog, openPause, renderWorlds -### src/ui/settings.js (124 lines) +### src/ui/settings.js (125 lines) The settings screen. - functions: openSettings, renderSettings, applySettings, toggleFullscreen, confirmWipe - variables: SET_TABS, setTab @@ -418,7 +418,7 @@ The selected tool and piece: R / Q / E, drill width, filter picker, the selectio Discovery cards, hover info (I) and the cursor label. - functions: showCard, howText, discoveryCard, reactionsOf, hoverInfo, renderInfo, drawCursorLabel -### src/ui/input.js (89 lines) +### src/ui/input.js (91 lines) Keyboard and mouse listeners. - functions: isTyping - variables: canvas @@ -442,7 +442,12 @@ Previews drawn under the cursor: build ghosts, drill aim and pulses, selections, Events from the simulation (emit) turned into sounds, toasts and cards. - functions: drainEvents -### src/ui/loop.js (133 lines) +### src/ui/map.js (93 lines) +Shared world colours, minimap and full map. +- functions: resetMap, mapArea, updateMap, drawMap, mapFit, drawFullMap, openMap, zoomMap, zoomMinimap +- variables: MAP_S, MAP + +### src/ui/loop.js (134 lines) The frame loop and boot. - functions: scanVisible, frame, boot - variables: lastT, acc, lastRender, frameMs, simMs, fpsSm, ambientT diff --git a/docs/agent-log.md b/docs/agent-log.md index 2e50024..0bc767f 100644 --- a/docs/agent-log.md +++ b/docs/agent-log.md @@ -4,6 +4,16 @@ What agents have done, newest first. Add an entry for every piece of work: the d note or request it was for, what changed, the files touched, the tests run, and anything left open or not verified. Keep each entry short; the git history has the details. +## 2026-10-24: t32: minimap and full map (Claude Code, Codex) + +- `src/ui/map.js`: colour cache (`resetMap`, `mapArea`, `updateMap` from the frame loop), + minimap (`#minimap` in `#hud .br`, `SET.minimap`, `SET.minimapZoom`), full map modal `m-map` + (`openMap`, `zoomMap`, drag pan). `input.js`: M map, Shift+M mute. `#cards` moved to `.bc`. +- Frame time on Medium: 2.18 ms with the minimap off, 2.29 ms on. +- Tests: play.py map checks (buttons, zoom setting, cache updates after digging, fog black, M/Esc, + Shift+M, cards in .bc, setting hides it, frame time). `run_all.py --browser` ALL PASSED. + Screenshots `shots/t32-hud.png`, `shots/t32-map.png`, `shots/t32-map-fog.png`. + ## 2026-10-24: New worlds get camp names too (Claude Code, Codex) - The new-world dialog prefills `claimName(seed, existing names)` instead of "World N", and diff --git a/src/manifest.json b/src/manifest.json index c1fda92..c578ac8 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -59,6 +59,7 @@ "ui/gamepad.js", "ui/previews.js", "ui/events.js", + "ui/map.js", "ui/loop.js" ] } diff --git a/src/shell.html b/src/shell.html index e4539b2..d4dda3f 100644 --- a/src/shell.html +++ b/src/shell.html @@ -32,9 +32,10 @@
-
+
+
@@ -113,6 +114,14 @@ + +