Skip to content

Engine train 10: draw the starter UI's map page as the app's own map - #238

Merged
vadi2 merged 2 commits into
mainfrom
ccr-14671218-tf96z6-engine-train-10
Nov 22, 2026
Merged

vadi2 merged 2 commits into
mainfrom
ccr-14671218-tf96z6-engine-train-10

Conversation

@vadi2

@vadi2 vadi2 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Brief overview of PR changes/additions

The starter UI's Map tab now draws rooms as the map button's map does: the same outlines, line weights, exits and
levels above and below.

  • setMapScale takes an optional density, the screen's. A mapper shown larger than the app's dp is laid out in
    dp and drawn scaled down to its window.
  • Mudlet patch 0045: THeadlessSession::renderMap() takes a layoutScale. Pointer, wheel, drags and the view stay
    in the window's pixels.
  • The window's size, the zoom and what scripts see stay as they were. No protocol version bump: an old engine
    ignores the field, and a request without it draws as before.
  • Tests: host test map_layout compares the mapper's and the app map's pixels around a room, and checks a press, a
    drag and a pinch in window pixels; ScriptMapTest checks the density sent.

Motivation for adding to Mudlet

A player found the Map tab worse than the map button's map: its small mapper window was laid out in its own pixels and magnified, and Mudlet's painter sets border fading, borderless rooms and outline widths in absolute pixels, so every room was drawn as a tiny one.

Other info (issues closed, discussion etc)

Part of Mudlet/Mudlet#9011

Checked: patches 0001-0045 apply and re-apply at Mudlet development e47ab4596; clang-format, strings, vendored, conflict markers. CI: PR CI and PTB green on 75cb0e4. bite: 44959525533, host test map_layout red without the engine's layout scale (380 of 1681 pixels differ); app-side 44967621658, the app sending no density: ScriptMapTest red on both emulators, nothing else. device-only: how the Map tab looks on a phone.
Size (PTB arm64-v8a): total 82.25 MB of 81.98 MB, dex 4.10 MB of 3.96 MB, within the 5% headroom

🤖 Generated with Claude Code

https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J

@vadi2
vadi2 force-pushed the ccr-14671218-tf96z6-engine-train-10 branch from 57f12fe to 2eabb26 Compare November 21, 2026 22:59
A script's mapper shown much larger than its window, as the starter UI's Map page is on a phone, was laid out in
the window's own pixels and magnified: Mudlet's outlines, line weights and the room size below which a room's
border fades and then goes are in pixels, so its rooms lost their borders, the levels above and below became
filled dots and the exits grew thin, unlike the map button's map of the same area.

setMapScale takes the screen's density as an optional density, and the engine lays such a mapper out in the
app's dp and draws it scaled down to the window (renderMap()'s layoutScale, Mudlet patch 0045), so its rooms are
drawn as on the app's own map. The window's size, the zoom, the view and the points stay what the script set and
sees. An engine without it ignores the field and a UI without it sends none, so the protocol keeps its version.

Part of Mudlet/Mudlet#9011

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
Mudlet's painter tints a selected room, so a frame drawn after the press can
never show room 2 in its own colour.

Part of Mudlet/Mudlet#9011

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016ujaeFyaqXXDx8xjoThE6J
@vadi2
vadi2 force-pushed the ccr-14671218-tf96z6-engine-train-10 branch from 2eabb26 to 75cb0e4 Compare November 21, 2026 23:50
@vadi2
vadi2 merged commit 476bc2d into main Nov 22, 2026
23 checks passed
@vadi2
vadi2 deleted the ccr-14671218-tf96z6-engine-train-10 branch November 22, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants