mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-10 14:24:51 +00:00
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:
@@ -37,7 +37,6 @@ import {
|
||||
import { WorkerClient } from "../core/worker/WorkerClient";
|
||||
import { getPersistentID } from "./Auth";
|
||||
import {
|
||||
AlternateViewEvent,
|
||||
AutoUpgradeEvent,
|
||||
DoBoatAttackEvent,
|
||||
DoBreakAllianceEvent,
|
||||
@@ -473,11 +472,6 @@ async function createClientGame(
|
||||
(e) => applyDayNightMode((e as CustomEvent<string>).detail === "true"),
|
||||
);
|
||||
|
||||
// Space-hold (and the settings-modal toggle) drives the affiliation
|
||||
// recolor. InputHandler emits AlternateViewEvent; the WebGL view needs
|
||||
// setAltView called to switch passes into alt mode.
|
||||
eventBus.on(AlternateViewEvent, (e) => view.setAltView(e.alternateView));
|
||||
|
||||
view.setShowPatterns(userSettings.territoryPatterns());
|
||||
globalThis.addEventListener(
|
||||
`${USER_SETTINGS_CHANGED_EVENT}:settings.territoryPatterns`,
|
||||
|
||||
Reference in New Issue
Block a user