mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 15:19:16 +00:00
move TransformHandler/UIState/Controller out of graphics/, drop dead GhostStructureChangedEvent
graphics/ was a canvas2D-era directory name — TransformHandler, UIState, and the Controller interface aren't graphics, they're cross-cutting client state. Hoist them to src/client/ so the path matches what they are. GhostStructureChangedEvent had three emitters and zero listeners; removed.
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
WarshipSelectionBoxCompleteEvent,
|
||||
WarshipSelectionBoxUpdateEvent,
|
||||
} from "../src/client/InputHandler";
|
||||
import { UIState } from "../src/client/graphics/UIState";
|
||||
import { UIState } from "../src/client/UIState";
|
||||
import { EventBus } from "../src/core/EventBus";
|
||||
import { UnitType } from "../src/core/game/Game";
|
||||
import { GameView, PlayerView } from "../src/core/game/GameView";
|
||||
@@ -928,13 +928,10 @@ describe("Warship box selection (Shift+drag)", () => {
|
||||
|
||||
test("Shift keydown discards active ghostStructure", () => {
|
||||
uiState.ghostStructure = UnitType.Warship;
|
||||
const emitSpy = vi.spyOn(eventBus, "emit");
|
||||
|
||||
window.dispatchEvent(new KeyboardEvent("keydown", { code: "ShiftLeft" }));
|
||||
|
||||
expect(uiState.ghostStructure).toBeNull();
|
||||
const types = emitSpy.mock.calls.map((c) => c[0].constructor.name);
|
||||
expect(types).toContain("GhostStructureChangedEvent");
|
||||
});
|
||||
|
||||
test("Shift+drag emits WarshipSelectionBoxUpdateEvent", () => {
|
||||
|
||||
Reference in New Issue
Block a user