aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.html6
-rw-r--r--webAO/client.js14
2 files changed, 12 insertions, 8 deletions
diff --git a/webAO/client.html b/webAO/client.html
index 119e3d8..3c06689 100644
--- a/webAO/client.html
+++ b/webAO/client.html
@@ -287,8 +287,10 @@
<audio id="client_sfxaudio" onvolumechange="changeSFXVolume()" controls></audio>
<p>Blip</p>
- <input id="client_bvolume" class="long" type="range" min="0" max="100" value="60"
- onchange="changeBlipVolume()">
+ <audio id="client_blipaudio0" onvolumechange="changeBlipVolume()" controls></audio>
+ <audio id="client_blipaudio1"></audio>
+ <audio id="client_blipaudio2"></audio>
+ <audio id="client_blipaudio3"></audio>
<br>
<br>
<button id="char_change" alt="Change" class="client_button hover_button" onclick="changeCharacter()">Change
diff --git a/webAO/client.js b/webAO/client.js
index f0a74d8..6aaa8e9 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -375,7 +375,7 @@ class Client extends EventEmitter {
changeMusicVolume();
document.getElementById("client_sfxaudio").volume = getCookie("sfxVolume");
changeSFXVolume();
- document.getElementById("client_bvolume").value = getCookie("blipVolume");
+ document.getElementById("client_blipaudio0").value = getCookie("blipVolume");
changeBlipVolume();
document.getElementById("ic_chat_name").value = getCookie("ic_chat_name");
@@ -1179,9 +1179,11 @@ class Viewport {
// Allocate multiple blip audio channels to make blips less jittery
- this.blipChannels = new Array(6);
- this.blipChannels.fill(new Audio(AO_HOST + "sounds/general/sfx-blipmale.wav"))
- .forEach(channel => channel.volume = 0.5);
+ this.blipChannels = [document.getElementById("client_blipaudio0"),
+ document.getElementById("client_blipaudio1"),
+ document.getElementById("client_blipaudio2"),
+ document.getElementById("client_blipaudio3")];
+
this.currentBlipChannel = 0;
this.sfxaudio = document.getElementById("client_sfxaudio");
@@ -1860,8 +1862,8 @@ window.changeSFXVolume = changeSFXVolume;
* Triggered by the blip volume slider.
*/
export function changeBlipVolume() {
- viewport.blipVolume = document.getElementById("client_bvolume").value / 100;
- setCookie("blipVolume", document.getElementById("client_bvolume").value);
+ viewport.blipVolume = document.getElementById("client_blipaudio0").volume;
+ setCookie("blipVolume", document.getElementById("client_blipaudio0").volume);
}
window.changeBlipVolume = changeBlipVolume;