diff options
| author | sD <stoned@derpymail.org> | 2020-02-15 21:25:55 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2020-02-15 21:25:55 +0100 |
| commit | 131bc522be92901321e89896a00d548f4b55ac4f (patch) | |
| tree | 671c4607683f3b3277f91543bc1d5e7f4e4f989a /webAO/client.js | |
| parent | 842dc4b9c7652058bf4214c28468f608fd1215c0 (diff) | |
Revert "use the element for sfx"
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/webAO/client.js b/webAO/client.js index f0a74d8..dda1c63 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -373,7 +373,7 @@ class Client extends EventEmitter { document.getElementById("client_musicaudio").volume = getCookie("musicVolume"); changeMusicVolume(); - document.getElementById("client_sfxaudio").volume = getCookie("sfxVolume"); + document.getElementById("client_svolume").value = getCookie("sfxVolume"); changeSFXVolume(); document.getElementById("client_bvolume").value = getCookie("blipVolume"); changeBlipVolume(); @@ -1184,7 +1184,7 @@ class Viewport { .forEach(channel => channel.volume = 0.5); this.currentBlipChannel = 0; - this.sfxaudio = document.getElementById("client_sfxaudio"); + this.sfxaudio = new Audio(AO_HOST + "sounds/general/sfx-blipmale.wav"); this.sfxplayed = 0; this.shoutaudio = new Audio(); @@ -1851,8 +1851,9 @@ window.changeMusicVolume = changeMusicVolume; * Triggered by the sound effect volume slider. */ export function changeSFXVolume() { - viewport.shoutaudio.volume = document.getElementById("client_sfxaudio").volume; - setCookie("sfxVolume", document.getElementById("client_sfxaudio").volume); + viewport.sfxaudio.volume = document.getElementById("client_svolume").value / 100; + viewport.shoutaudio.volume = document.getElementById("client_svolume").value / 100; + setCookie("sfxVolume", document.getElementById("client_svolume").value); } window.changeSFXVolume = changeSFXVolume; |
