Skip to content

Draw the /ch chunks map as a dialog of chunk buttons - #32

Open
tastybento wants to merge 3 commits into
developfrom
feature/chunks-map-dialog
Open

Draw the /ch chunks map as a dialog of chunk buttons#32
tastybento wants to merge 3 commits into
developfrom
feature/chunks-map-dialog

Conversation

@tastybento

Copy link
Copy Markdown
Member

The chat map of /ch chunks renders differently on every client — font, chat width and GUI scale all pull the glyph grid out of shape. This makes the map a dialog instead: a multi-action dialog laid out at 2 * radius + 1 columns, so every button is a chunk and the grid is the same fixed-size boxes for everyone.

What it does

  • panels/ChunksDialog builds the grid. Buttons keep the chat map's glyphs ( yours, claimable, locked, center, aqua // for the chunk you're standing on), so the existing legend still reads.
  • Tooltips name the chunk by its offset and, for a frontier chunk, quote the price — or how many more levels of credit are needed.
  • Clicking is read-only: it reopens the map with that chunk described in the body. Chunks are still claimed by hitting the border, as before.
  • Body lines reuse chunks.info, chunks.rings and map.legend; the title reuses map.title.
  • Fallback: if the server can't show dialogs (Dialogs.isSupported()) or the build throws, show() returns false and the command falls through to the unchanged chat map.

Locales

en-US.yml gains chunkblock.chunks.dialog.* — a close label and five tooltips. Other locales are not synced yet.

Tuning

MAX_RADIUS = 6 (13×13 grid, vs 7 rings in chat) and BUTTON_WIDTH = 26 are constants at the top of ChunksDialog; they were picked to fit the dialog screen and may want a nudge after more in-game use.

Tests

New ChunksDialogTest covers the cell grid: kinds, frontier vs diagonal corners, growth outwards, the radius cap, you-are-here marking, glyph mapping and row ordering. Full suite green (668 tests).

🤖 Generated with Claude Code

https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp

tastybento and others added 3 commits August 14, 2026 07:41
Chat renders a glyph grid differently on every client — font, chat width
and scale all pull it out of shape. The map is now a multi-action dialog
laid out at 2 * radius + 1 columns, so every chunk is a fixed-size button
and the grid looks the same everywhere.

Each button keeps the chat map's glyph, so the legend still reads, and
adds a tooltip naming the chunk and, on the frontier, what it costs or
how much credit is still missing. Clicking is read-only — it reopens the
map with that chunk described at the top; chunks are still claimed by
hitting the border.

Servers too old for dialogs fall back to the chat map unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp
Adds the dialog map's close button and six tooltips, plus the three ring
keys the dialog body and the ring announcements use. Also completes the
map legend, which stopped at the locked glyph and never got the center
and you-are-here marks.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp
The map was building glyphs as legacy "&b◉" strings and, for the chat
map, splicing a whole row of them into the [row] variable of a
translation. With locale text moving to MiniMessage that is a bug
waiting to happen: colour codes inside a MiniMessage line are not
formatting, they are text.

Pulls the grid out into ChunkMap, shared by the dialog and the chat
fallback, and hands out glyphs as coloured Components. The chat map,
which can only put text into [row], serializes those Components to
MiniMessage instead. Dialog text now goes through
User#getTranslationAsComponent rather than parsing the translation here,
and the new dialog locale entries are written in MiniMessage.

Verified both ways round: a MiniMessage row renders identically under a
legacy "&a [row]" template and a MiniMessage one, so locale files
already on disk keep working.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017EZEwab2kL4i1FNnBYvSmp
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant