summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-01-02 14:43:36 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-01-02 14:43:36 -0500
commit4a4805603d4e810802533fa1f9d92ead10bcddbb (patch)
treefd871e427760db1b130aafdb1cca3dcfde5e8251 /www
parentdcc3c18bd7689d2ce625e7af38267ca0b43b1267 (diff)
downloadhtml5ks-4a4805603d4e810802533fa1f9d92ead10bcddbb.tar.xz
html5ks-4a4805603d4e810802533fa1f9d92ead10bcddbb.zip
Fix ambient volume.
soundVolume -> sfxVolume
Diffstat (limited to 'www')
-rw-r--r--www/index.html6
-rw-r--r--www/js/api.js5
-rw-r--r--www/js/html5ks.js2
3 files changed, 7 insertions, 6 deletions
diff --git a/www/index.html b/www/index.html
index 2798621..73eb483 100644
--- a/www/index.html
+++ b/www/index.html
@@ -49,11 +49,11 @@
<div id="window" style="display: none;">
<div id="who"></div>
<div id="say" class="say"></div>
- <span class="ctc" id="ctc" style="display: none" alt="Click to continue...">
+ <span class="ctc" id="ctc" style="display: none" alt="Click to continue..."></span>
</div>
<div id="nvl" style="display: none;">
<div id="nvlsay" class="say"></div>
- <img class="ctc" id="nvlctc" alt="Click to continue...">
+ <span class="ctc" id="nvlctc" style="display: none" alt="Click to continue..."></span>
</div>
<div id="choices" class="centered"></div>
<div id="centered" class="centered say"></div>
@@ -85,7 +85,7 @@
<label><input type="range" min="0.0" max="1.0" step="0.001" class="option" id="autoModeDelay"> <span class="tr config_afmspeed_label"></span></label>
<label><input type="range" min="0.0" max="1.0" step="0.001" class="option" id="musicVolume"> <span class="tr config_musicvol_label"></span></label>
- <label><input type="range" min="0.0" max="1.0" step="0.001" class="option" id="soundVolume"> <span class="tr config_sfxvol_label"></span> <span id="test-sound" class="button config_sfxtest_label"><img src="dump/ui/bt-musicplay.png" alt="Play"></span></label>
+ <label><input type="range" min="0.0" max="1.0" step="0.001" class="option" id="sfxVolume"> <span class="tr config_sfxvol_label"></span> <span id="test-sound" class="button config_sfxtest_label"><img src="dump/ui/bt-musicplay.png" alt="Play"></span></label>
</div>
<div id="return" class="button" style="position: absolute; bottom: 15px; right: 20px;">
<img src="dump/ui/bt-return.png">
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) : {};