mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:10:46 +00:00
SoundUpdateEvent to Sounds.ts
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user