summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/api.js5
-rw-r--r--www/js/html5ks.js2
2 files changed, 4 insertions, 3 deletions
diff --git a/www/js/api.js b/www/js/api.js
index a46511f..22342c5 100644
--- a/www/js/api.js
+++ b/www/js/api.js
@@ -38,15 +38,17 @@ window.html5ks.api = new (function () {
}
html5ks.elements.audio[channel] = audio;
- var src = "dump/";
+ var src = "dump/", volume;
switch (channel) {
case "music":
src += "bgm/" + html5ks.data.music[name];
+ volume = html5ks.persistent.musicVolume;
break;
case "ambient":
case "sound":
src += "sfx/" + html5ks.data.sfx[name];
+ volume = html5ks.persistent.sfxVolume;
}
["opus", "ogg", "m4a", "wav"].some(function (type) {
@@ -67,7 +69,6 @@ window.html5ks.api = new (function () {
throw new Error(e);
};
audio.load();
- var volume = html5ks.persistent[channel + "Volume"];
audio.volume = fade ? 0 : volume;
audio.play();
return deferred.promise;
diff --git a/www/js/html5ks.js b/www/js/html5ks.js
index 59bd940..a413ed5 100644
--- a/www/js/html5ks.js
+++ b/www/js/html5ks.js
@@ -20,7 +20,7 @@ window.html5ks = {
autoModeDelay: 0.2,
musicVolume: 1,
ambientVolume: 1,
- soundVolume: 1,
+ sfxVolume: 1,
language: "en"
};
var loaded = localStorage.persistent ? JSON.parse(localStorage.persistent) : {};