Promote per-glyph default tile colours into glyphs.json (#36 follow-up) - #44
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #36 (the
TODO(#36)left inglyph_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
colorfield on each glyph, flowing server →welcomewire → client exactly like the existingsprite/consolefields, so they're authorable/moddable inglyphs.json.Pure data-plumbing — no visual or behaviour change (identical colours, now data-driven):
server/src/dh_server/glyphs.gleam:color: Option(Int)onCenterSpec+EdgeSpec(mirrorssprite/console); threaded through decoder/encoder/default().server/glyphs.json+ schema:"color"(0–15) on the decor/console/window/stairs entries. Bedd(centre) and bunkd(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_colorkeep their signatures.Verification:
gleam test244 passed (incl.glyphs_testdefault==json byte-identity);gleam format --checkclean; headless self-test PASS; render probe clean.🤖 Generated with Claude Code