Wire view-mode toggles (alt-view + coordinate grid) via new ViewModeController

Moves the AlternateViewEvent / ToggleCoordinateGridEvent subscriptions out of
ClientGameRunner into a dedicated controller in src/client/controllers/. Also
wires ToggleCoordinateGridEvent (M keybind) — previously emitted with no
listener — so the persistent coordinate-grid toggle works. Grid + alt-view
hide names only under alt-view; M keeps names visible.
This commit is contained in:
evanpelle
2026-05-22 18:30:18 +01:00
parent ee04a19d3c
commit b486caa6f4
6 changed files with 39 additions and 9 deletions
+3
View File
@@ -371,6 +371,9 @@ export class GameView {
setAltView(active: boolean): void {
this.renderer?.setAltView(active);
}
setGridView(active: boolean): void {
this.renderer?.setGridView(active);
}
setShowPatterns(active: boolean): void {
this.renderer?.setShowPatterns(active);
}
+4 -2
View File
@@ -1176,8 +1176,10 @@ export class GPURenderer {
this.worldTextPass.tick();
this.worldTextPass.draw(cam, zoom);
if (this.gridView) this.coordinateGridPass.draw(cam, zoom);
if (pe.name && !this.gridView)
// Grid shows on either trigger; names hide only under alt-view (space
// hold), not under the persistent M-key gridView toggle.
if (this.gridView || this.altView) this.coordinateGridPass.draw(cam, zoom);
if (pe.name && !this.altView)
this.namePass.draw(cam, this.nightCompositePass.getAmbient());
this.radialMenuPass.draw();
+1 -1
View File
@@ -255,7 +255,7 @@
"gradientSolidEnd": 0.1
},
"altView": {
"gridFontSize": 16,
"gridFontSize": 24,
"recolorStructures": true
},
"tileDrip": {