From 2af4955c1604e71dcf060f6304a51312b11dac44 Mon Sep 17 00:00:00 2001 From: VariableVince <24507472+VariableVince@users.noreply.github.com> Date: Sat, 23 May 2026 22:25:10 +0200 Subject: [PATCH] SoundUpdateEvent to Sounds.ts --- src/client/ClientGameRunner.ts | 7 ++----- src/client/controllers/SoundController.ts | 7 +++++-- src/client/sound/Sounds.ts | 5 +++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/client/ClientGameRunner.ts b/src/client/ClientGameRunner.ts index c834ea10f..5a4b18c82 100644 --- a/src/client/ClientGameRunner.ts +++ b/src/client/ClientGameRunner.ts @@ -1,6 +1,6 @@ import { Config } from "src/core/configuration/Config"; import { translateText } from "../client/Utils"; -import { EventBus, GameEvent } from "../core/EventBus"; +import { EventBus } from "../core/EventBus"; import { ClientID, GameID, @@ -69,6 +69,7 @@ import { createRenderer, GameRenderer } from "./hud/GameRenderer"; import { GameView as WebGLGameView } from "./render/gl"; import { ALL_UNIT_TYPES, UnitState } from "./render/types"; import { SoundManager } from "./sound/SoundManager"; +import { SoundUpdateEvent } from "./sound/Sounds"; export interface LobbyConfig { cosmetics: PlayerCosmeticRefs; @@ -519,10 +520,6 @@ async function createClientGame( } } -export class SoundUpdateEvent implements GameEvent { - constructor(public gu: GameUpdateViewData) {} -} - export class ClientGameRunner { private myPlayer: PlayerView | null = null; private isActive = false; diff --git a/src/client/controllers/SoundController.ts b/src/client/controllers/SoundController.ts index 6c1fbaa03..fcd773608 100644 --- a/src/client/controllers/SoundController.ts +++ b/src/client/controllers/SoundController.ts @@ -6,9 +6,12 @@ import { UnitUpdate, } from "../../core/game/GameUpdates"; import { GameView } from "../../core/game/GameView"; -import { SoundUpdateEvent } from "../ClientGameRunner"; import { Controller } from "../Controller"; -import { PlaySoundEffectEvent, SoundEffect } from "../sound/Sounds"; +import { + PlaySoundEffectEvent, + SoundEffect, + SoundUpdateEvent, +} from "../sound/Sounds"; export class SoundController implements Controller { constructor( diff --git a/src/client/sound/Sounds.ts b/src/client/sound/Sounds.ts index 372c0ce94..4646ea04d 100644 --- a/src/client/sound/Sounds.ts +++ b/src/client/sound/Sounds.ts @@ -1,5 +1,6 @@ import { assetUrl } from "../../core/AssetUrls"; import { GameEvent } from "../../core/EventBus"; +import { GameUpdateViewData } from "../../core/game/GameUpdates"; export enum SoundEffect { KaChing = "ka-ching", @@ -49,6 +50,10 @@ export class PlaySoundEffectEvent implements GameEvent { constructor(public readonly effect: SoundEffect) {} } +export class SoundUpdateEvent implements GameEvent { + constructor(public gu: GameUpdateViewData) {} +} + export class SetSoundEffectsVolumeEvent implements GameEvent { constructor(public readonly volume: number) {} }