summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-06-27 23:11:16 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-06-27 23:11:16 -0400
commit012ac4ef2f91ed67d36c5e06510cec8c00517de3 (patch)
tree944e2c375770e1757fa92d2bbe942e8e27965c2f
parentf3a9805dc55133320a48feb094475aa9bd84bcac (diff)
downloadhtml5ks-012ac4ef2f91ed67d36c5e06510cec8c00517de3.tar.xz
html5ks-012ac4ef2f91ed67d36c5e06510cec8c00517de3.zip
jmp to main menu after en_NOP1, dec version
-rw-r--r--www/index.html2
-rw-r--r--www/js/api.js6
-rw-r--r--www/js/menu.js2
3 files changed, 6 insertions, 4 deletions
diff --git a/www/index.html b/www/index.html
index 8c0ef82..9cc9dc3 100644
--- a/www/index.html
+++ b/www/index.html
@@ -60,7 +60,7 @@
<div id="version" style="position: absolute; bottom: 10px; right: 15px; font: 8px/8px Playtime; opacity: 0.4">
Katawa Shoujo v1.0
<br>
- HTML5KS 0.0.1
+ HTML5KS 0.0.0
</div>
</div>
<div id="dialogs" style="display: none; position: absolute; top: 50%; width: 504px; height: 395px; background: url(dump/ui/bg-config.png); left: 50%; margin-left: -252px; margin-top: -197.5px;">
diff --git a/www/js/api.js b/www/js/api.js
index e5a6a58..b50f4c3 100644
--- a/www/js/api.js
+++ b/www/js/api.js
@@ -92,16 +92,18 @@ window.html5ks.api = {
},
iscene: function (target, is_h, is_end) {
this.scene_register(target);
- var label = html5ks.data.script[target],
+ var deferred = when.defer(),
+ label = html5ks.data.script[target],
i = 0;
(function run() {
if (label[i]) {
html5ks.api.runInst(label[i]).then(run, console.error);
i++;
} else {
- html5ks.mainMenu();
+ deferred.resolve();
}
}());
+ return deferred.promise;
},
window: function (action, transition) {
diff --git a/www/js/menu.js b/www/js/menu.js
index 8d68fcd..ad37964 100644
--- a/www/js/menu.js
+++ b/www/js/menu.js
@@ -20,7 +20,7 @@ html5ks.menu = {
initEvents: function () {
document.getElementById("start").addEventListener("click", function () {
html5ks.elements.mainMenu.style.display = "none";
- html5ks.api.iscene("en_NOP1");
+ html5ks.api.iscene("en_NOP1").then(html5ks.menu.mainMenu);
}, false);
document.getElementById("options-button").addEventListener("click", function () {
html5ks.menu.dialog("options");