SoundUpdateEvent to Sounds.ts

This commit is contained in:
VariableVince
2026-05-23 22:25:10 +02:00
parent 5210a51aa0
commit 2af4955c16
3 changed files with 12 additions and 7 deletions
+2 -5
View File
@@ -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;
+5 -2
View File
@@ -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(
+5
View File
@@ -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) {}
}