Skip to content

Promote per-glyph default tile colours into glyphs.json (#36 follow-up) - #44

Merged
Dibujaron merged 2 commits into
mainfrom
feat/interior-default-colors
Jul 21, 2026
Merged

Promote per-glyph default tile colours into glyphs.json (#36 follow-up)#44
Dibujaron merged 2 commits into
mainfrom
feat/interior-default-colors

Conversation

@Dibujaron

Copy link
Copy Markdown
Owner

Follow-up to #36 (the TODO(#36) left in glyph_registry.gd).

The per-glyph default tile colours — used to tint decor that carries no NE-corner colour, so it reads in colour instead of pale greyscale — were hard-coded in a client-side map. This moves them into the glyph registry data as an optional color field on each glyph, flowing server → welcome wire → client exactly like the existing sprite/console fields, so they're authorable/moddable in glyphs.json.

Pure data-plumbing — no visual or behaviour change (identical colours, now data-driven):

  • server/src/dh_server/glyphs.gleam: color: Option(Int) on CenterSpec + EdgeSpec (mirrors sprite/console); threaded through decoder/encoder/default().
  • server/glyphs.json + schema: "color" (0–15) on the decor/console/window/stairs entries. Bed d (centre) and bunk d (edge) deliberately have none — they bake red/white into their sprites.
  • client/scripts/glyph_registry.gd: reads the colour from the parsed registry (center_color_by_glyph/edge_color_by_glyph); the hard-coded _DEFAULT_* maps are deleted. default_center_color/default_edge_color keep their signatures.

Verification: gleam test 244 passed (incl. glyphs_test default==json byte-identity); gleam format --check clean; headless self-test PASS; render probe clean.

🤖 Generated with Claude Code

…follow-up)

Add an optional `color` field to CenterSpec/EdgeSpec, mirroring how
`sprite`/`console` already flow server -> welcome wire -> client, so the
per-glyph default tile tint is authorable/moddable data instead of a
hard-coded table in glyph_registry.gd. Same colours, no visual change.
@Dibujaron
Dibujaron merged commit 53cbb38 into main Jul 21, 2026
1 check passed
@Dibujaron
Dibujaron deleted the feat/interior-default-colors branch July 21, 2026 00: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.

1 participant