From 4a4805603d4e810802533fa1f9d92ead10bcddbb Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Thu, 2 Jan 2014 14:43:36 -0500 Subject: Fix ambient volume. soundVolume -> sfxVolume --- www/js/api.js | 5 +++-- www/js/html5ks.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'www/js') 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) : {}; -- cgit v1.2.3-70-g09d2