aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2019-08-19 20:25:19 +0200
committerstonedDiscord <stoned@derpymail.org>2019-08-19 20:25:19 +0200
commit5fdf3c52bc794217f23ead0c7afdc79bfb042be3 (patch)
treef665e7cca8e3dc8a453309e26ecb98140d2d1a3e /webAO/client.js
parentb2a76df49c6c4753b33c0cee2674a15436863321 (diff)
fix #12
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/webAO/client.js b/webAO/client.js
index ed2d575..a8d6256 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -943,6 +943,8 @@ class Viewport {
this.sfxaudio = new Audio(AO_HOST + "sounds/general/sfx-blipmale.wav");
this.sfxplayed = 0;
+ this.shoutaudio = new Audio();
+
this.music = new Audio();
this.music.play();
@@ -1158,7 +1160,8 @@ class Viewport {
const shout = shouts[this.chatmsg.objection];
if (shout) {
shoutSprite.src = client.resources[shout]["src"];
- (new Audio(`${AO_HOST}characters/${this.chatmsg.name.toLowerCase()}/${shout}.wav`)).play();
+ this.shoutaudio.src=`${AO_HOST}characters/${this.chatmsg.name.toLowerCase()}/${shout}.wav`;
+ this.shoutaudio.play();
this.shoutTimer = 850;
} else {
this.shoutTimer = 0;
@@ -1459,6 +1462,7 @@ window.changeMusicVolume = changeMusicVolume;
*/
export function changeSFXVolume() {
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;