From e0ef7ad9a89854e0268b03203f5b00c9ddd49a40 Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 13 Jul 2020 18:35:55 +0200 Subject: add slider --- webAO/client.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index 717f9ea..3ffafdd 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -340,6 +340,9 @@

Shouts

+ +

Testimony/Guilty

+

Blip

Date: Mon, 13 Jul 2020 18:37:36 +0200 Subject: remember the cookie --- webAO/client.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'webAO') diff --git a/webAO/client.js b/webAO/client.js index 938c566..4f3d4fc 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(); @@ -2182,6 +2184,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. */ -- cgit From 37134ff18d3b131adc75dbfa1a2a0abbebf5c5e8 Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 13 Jul 2020 18:41:23 +0200 Subject: use the new testimony element --- webAO/client.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'webAO') diff --git a/webAO/client.js b/webAO/client.js index 4f3d4fc..d4365dd 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -1329,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`; @@ -1474,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; -- cgit From 1b041636447023a79dda1b1418434e99181c3bfe Mon Sep 17 00:00:00 2001 From: sD Date: Mon, 13 Jul 2020 18:45:36 +0200 Subject: typo in onvolumechange --- webAO/client.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'webAO') diff --git a/webAO/client.html b/webAO/client.html index 3ffafdd..9e18c5a 100644 --- a/webAO/client.html +++ b/webAO/client.html @@ -342,7 +342,7 @@

Testimony/Guilty

- +

Blip