diff options
| author | stonedDiscord <stoned@derpymail.org> | 2020-07-13 18:58:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-13 18:58:35 +0200 |
| commit | 7c90dc6de481d6904a0266a3dff251e3351eb6ee (patch) | |
| tree | 37ff3bb42b55b51892694f109b310353b8d3ca49 | |
| parent | 284c907dfda629be2f3ff9f6875f0a61119b80cc (diff) | |
| parent | 1b041636447023a79dda1b1418434e99181c3bfe (diff) | |
Merge pull request #61 from AttorneyOnline/testimony_volume
Testimony volume
| -rw-r--r-- | webAO/client.html | 3 | ||||
| -rw-r--r-- | webAO/client.js | 16 |
2 files changed, 18 insertions, 1 deletions
diff --git a/webAO/client.html b/webAO/client.html index 717f9ea..9e18c5a 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -340,6 +340,9 @@ <p>Shouts</p> <audio id="client_shoutaudio" onvolumechange="changeShoutVolume()" controls></audio> + + <p>Testimony/Guilty</p> + <audio id="client_testimonyaudio" onvolumechange="changeTestimonyVolume()" controls></audio> <p>Blip</p> <input id="client_bvolume" class="long" type="range" min="0" max="1" value="1" step="0.01" diff --git a/webAO/client.js b/webAO/client.js index 938c566..d4365dd 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -418,6 +418,8 @@ class Client extends EventEmitter { changeSFXVolume(); document.getElementById("client_shoutaudio").volume = getCookie("shoutVolume") || 1; changeShoutVolume(); + document.getElementById("client_testimonyaudio").volume = getCookie("testimonyVolume") || 1; + changeTestimonyVolume(); document.getElementById("client_bvolume").value = getCookie("blipVolume") || 1; changeBlipVolume(); @@ -1327,6 +1329,9 @@ class Viewport { this.shoutaudio = document.getElementById("client_shoutaudio"); this.shoutaudio.src = `${AO_HOST}misc/default/objection.wav`; + this.testimonyAudio = document.getElementById("client_testimonyaudio"); + this.testimonyAudio.src = `${AO_HOST}sounds/general/sfx-notguilty.wav`; + this.music = document.getElementById("client_musicaudio"); this.music.src = `${AO_HOST}sounds/music/trial (aa).mp3`; @@ -1472,7 +1477,8 @@ async changeBackground(position) { return; } - (new Audio(client.resources[testimony].sfx)).play(); + this.testimonyAudio.src = client.resources[testimony].sfx; + this.testimonyAudio.play(); const testimonyOverlay = document.getElementById("client_testimony"); testimonyOverlay.src = client.resources[testimony].src; @@ -2183,6 +2189,14 @@ export function changeShoutVolume() { window.changeShoutVolume = changeShoutVolume; /** + * Triggered by the testimony volume slider. + */ +export function changeTestimonyVolume() { + setCookie("testimonyVolume", document.getElementById("client_testimonyaudio").volume); +} +window.changeTestimonyVolume = changeTestimonyVolume; + +/** * Triggered by the blip volume slider. */ export function changeBlipVolume() { |
