diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2014-01-02 14:43:36 -0500 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2014-01-02 14:43:36 -0500 |
commit | 4a4805603d4e810802533fa1f9d92ead10bcddbb (patch) | |
tree | fd871e427760db1b130aafdb1cca3dcfde5e8251 /www/js | |
parent | dcc3c18bd7689d2ce625e7af38267ca0b43b1267 (diff) | |
download | html5ks-4a4805603d4e810802533fa1f9d92ead10bcddbb.tar.xz html5ks-4a4805603d4e810802533fa1f9d92ead10bcddbb.zip |
Fix ambient volume.
soundVolume -> sfxVolume
Diffstat (limited to 'www/js')
-rw-r--r-- | www/js/api.js | 5 | ||||
-rw-r--r-- | www/js/html5ks.js | 2 |
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) : {}; |