aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2019-07-26 16:21:31 +0200
committerstonedDiscord <stoned@derpymail.org>2019-07-26 16:21:31 +0200
commit95a8f90da147e13761ee342008046854f396704d (patch)
treee9638656af47a08e17fa69e601005fc46ce5353e /webAO/client.js
parentbc0592b4c5f1f5c130c19eb89d4061b7cd77cdba (diff)
set UI elements instead of volume attribs
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 90d9ba0..9706ac8 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -284,9 +284,12 @@ class Client extends EventEmitter {
* Load game resources.
*/
loadResources() {
- // Set to playerID to server chat name
- // TODO: Make a text box for this!
- document.getElementById("OOC_name").value = getCookie("OOC_name") !== "" ? "web" + this.playerID : getCookie("OOC_name");
+ // Read cookies and set the UI to its values
+ document.getElementById("OOC_name").value = getCookie("OOC_name") === "" ? "web" + this.playerID : getCookie("OOC_name");
+
+ document.getElementById("client_mvolume").value = getCookie("musicVolume");
+ document.getElementById("client_svolume").value = getCookie("sfxVolume");
+ document.getElementById("client_bvolume").value = getCookie("blipVolume");
// Load evidence array to select
const evidence_select = document.getElementById("evi_select");
@@ -1442,6 +1445,7 @@ window.area_click = area_click;
*/
export function changeMusicVolume() {
viewport.music.volume = document.getElementById("client_mvolume").value / 100;
+ setCookie("musicVolume",document.getElementById("client_mvolume").value);
}
window.changeMusicVolume = changeMusicVolume;
@@ -1450,6 +1454,7 @@ window.changeMusicVolume = changeMusicVolume;
*/
export function changeSFXVolume() {
viewport.sfxaudio.volume = document.getElementById("client_svolume").value / 100;
+ setCookie("sfxVolume",document.getElementById("client_svolume").value);
}
window.changeSFXVolume = changeSFXVolume;
@@ -1458,6 +1463,7 @@ window.changeSFXVolume = changeSFXVolume;
*/
export function changeBlipVolume() {
viewport.blipVolume = document.getElementById("client_bvolume").value / 100;
+ setCookie("blipVolume",document.getElementById("client_bvolume").value);
}
window.changeBlipVolume = changeBlipVolume;