quake2ts 0.0.532 → 0.0.533

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16555,6 +16555,21 @@ function createClient(imports) {
16555
16555
  },
16556
16556
  description: "Toggle client-side prediction"
16557
16557
  });
16558
+ imports.host.cvars.register({
16559
+ name: "s_musicvolume",
16560
+ defaultValue: "1",
16561
+ flags: CvarFlags2.Archive,
16562
+ onChange: (cvar) => {
16563
+ const vol = cvar.number;
16564
+ if (!isNaN(vol)) {
16565
+ const audio = imports.engine.audio;
16566
+ if (audio && typeof audio.set_music_volume === "function") {
16567
+ audio.set_music_volume(Math.max(0, Math.min(1, vol)));
16568
+ }
16569
+ }
16570
+ },
16571
+ description: "Music volume"
16572
+ });
16558
16573
  const initialFov = imports.host.cvars.get("fov");
16559
16574
  if (initialFov) {
16560
16575
  const f = initialFov.number;
@@ -16562,6 +16577,16 @@ function createClient(imports) {
16562
16577
  fovValue = Math.max(1, Math.min(179, f));
16563
16578
  }
16564
16579
  }
16580
+ const initialMusicVol = imports.host.cvars.get("s_musicvolume");
16581
+ if (initialMusicVol) {
16582
+ const vol = initialMusicVol.number;
16583
+ if (!isNaN(vol)) {
16584
+ const audio = imports.engine.audio;
16585
+ if (audio && typeof audio.set_music_volume === "function") {
16586
+ audio.set_music_volume(Math.max(0, Math.min(1, vol)));
16587
+ }
16588
+ }
16589
+ }
16565
16590
  }
16566
16591
  }
16567
16592
  const clientExports = {