restore alt-view (space hold) toggle

InputHandler still emits AlternateViewEvent on space down/up, and the
renderer still has setAltView. The bridge between them lived in
MapInteraction's applyAltView, which got deleted with the rest of
MapInteraction — nothing was wiring the event to the view anymore.
Expose view.setAltView and have ClientGameRunner subscribe.
This commit is contained in:
evanpelle
2026-05-18 09:10:05 -07:00
parent 4cd22a9b5c
commit 61f6d2fdd4
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -37,6 +37,7 @@ import {
import { WorkerClient } from "../core/worker/WorkerClient";
import { getPersistentID } from "./Auth";
import {
AlternateViewEvent,
AutoUpgradeEvent,
DoBoatAttackEvent,
DoBreakAllianceEvent,
@@ -445,6 +446,11 @@ 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));
const gameRenderer = createRenderer(
inputOverlay,
gameView,
+3
View File
@@ -321,6 +321,9 @@ export class GameView {
setLocalPlayerID(id: number): void {
this.renderer.setLocalPlayerID(id);
}
setAltView(active: boolean): void {
this.renderer.setAltView(active);
}
setHighlightOwner(ownerID: number): void {
this.renderer.setHighlightOwner(ownerID);
}