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.
@@ -16521,6 +16521,21 @@ function createClient(imports) {
16521
16521
  },
16522
16522
  description: "Toggle client-side prediction"
16523
16523
  });
16524
+ imports.host.cvars.register({
16525
+ name: "s_musicvolume",
16526
+ defaultValue: "1",
16527
+ flags: CvarFlags2.Archive,
16528
+ onChange: (cvar) => {
16529
+ const vol = cvar.number;
16530
+ if (!isNaN(vol)) {
16531
+ const audio = imports.engine.audio;
16532
+ if (audio && typeof audio.set_music_volume === "function") {
16533
+ audio.set_music_volume(Math.max(0, Math.min(1, vol)));
16534
+ }
16535
+ }
16536
+ },
16537
+ description: "Music volume"
16538
+ });
16524
16539
  const initialFov = imports.host.cvars.get("fov");
16525
16540
  if (initialFov) {
16526
16541
  const f = initialFov.number;
@@ -16528,6 +16543,16 @@ function createClient(imports) {
16528
16543
  fovValue = Math.max(1, Math.min(179, f));
16529
16544
  }
16530
16545
  }
16546
+ const initialMusicVol = imports.host.cvars.get("s_musicvolume");
16547
+ if (initialMusicVol) {
16548
+ const vol = initialMusicVol.number;
16549
+ if (!isNaN(vol)) {
16550
+ const audio = imports.engine.audio;
16551
+ if (audio && typeof audio.set_music_volume === "function") {
16552
+ audio.set_music_volume(Math.max(0, Math.min(1, vol)));
16553
+ }
16554
+ }
16555
+ }
16531
16556
  }
16532
16557
  }
16533
16558
  const clientExports = {