diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2013-07-03 20:11:40 -0400 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2013-07-03 20:11:40 -0400 |
commit | 0e14fea8ebc1730d6937bcc46354188a0a14f87c (patch) | |
tree | d0554411cd49438b0fab77cbf29a1b2a6de27186 /www/js/imachine.js | |
parent | 77524b907b0737d97094f8530ff29578ae396414 (diff) | |
download | html5ks-0e14fea8ebc1730d6937bcc46354188a0a14f87c.tar.xz html5ks-0e14fea8ebc1730d6937bcc46354188a0a14f87c.zip |
implement menu... sorta (doesn't work properly)
Diffstat (limited to 'www/js/imachine.js')
-rw-r--r-- | www/js/imachine.js | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/www/js/imachine.js b/www/js/imachine.js index 8c2f86d..adad442 100644 --- a/www/js/imachine.js +++ b/www/js/imachine.js @@ -35,9 +35,14 @@ html5ks.imachine = (function () { html5ks.api.movie_cutscene("op_1").then(runInst); break; default: - html5ks.api[cmd].apply(html5ks.api, args).then(runInst); + html5ks.api[cmd].apply(html5ks.api, args).then(function () { runInst(); }); } break; + case "imenu": + html5ks.api.menu(args[0]).then(function (choice) { + html5ks.imachine.run(args[1][choice] || args[1].else); + }); + break; case "seen_scene": if (this.seen_scene(inst[1])) { this.run(inst[2]); @@ -45,17 +50,16 @@ html5ks.imachine = (function () { this.run(inst[3]); } break; - case "attraction_sc": - case "attraction_hanako": - case "attraction_kenji": - if (typeof inst[1] === "number") { - if (html5ks.persistent.store[inst[0]] > inst[1]) { + case "attraction": + if (typeof inst[2] === "number") { + if (html5ks.store.attraction[inst[1]] > inst[2]) { runInst(inst[3]); } else { runInst(inst[4]); } } else { - html5ks.persistent.store[inst[0]]++; + html5ks.store.attraction[inst[1]]++; + runInst(); } break; case "path_end": |