diff options
-rw-r--r-- | www/index.html.dist | 26 | ||||
-rw-r--r-- | www/js/api.js | 38 | ||||
-rw-r--r-- | www/js/menu.js | 2 |
3 files changed, 41 insertions, 25 deletions
diff --git a/www/index.html.dist b/www/index.html.dist index f5b0270..36fb5ba 100644 --- a/www/index.html.dist +++ b/www/index.html.dist @@ -12,19 +12,31 @@ </head> <body><div id="all"> <div id="interstitial"> - <div id="warn"> + <div id="standard"> + <p>Okay, before we start, we need to go through a few things first.</p> + <p>If you don't know what Katawa Shoujo is, see <a href="http://www.katawa-shoujo.com/">http://www.katawa-shoujo.com/</a>, then come back.</p> + <p>There's like, a little bit of... inappropriate content, so we have to make you promise you're over 18.</p> + <p>If you don't want to see any, er, explicit content, hit the appropriate checkbox at the bottom of the page.</p> + <p>Also, please don't bother the original developers on the forums or IRC about bugs in this. This is entirely unofficial and not controlled by them whatsoever.<br> + This includes missing features, typos, downtime, and any other glitches of any sort. Bug me instead: <a href="https://bugzilla.happinessforme.com/">https://bugzilla.happinessforme.com/</a>, or use the official distribution until HTML5KS is feature-complete. + </p> + <p>FYI, this site uses localStorage to keep your settings and saves. This information always stays on your computer and never goes anywhere. If you live in the EU, please don't sue me.</p> + </div> + <div id="missing-features"> <h2>We use a lot of new features in this; your browser seems to have some issues...</h2> - <ul id="warns"> + <ul id="features"> <li id="js">It doesn't seem to have JavaScript enabled. This site doesn't work at all without it. Really. <a href="http://enable-javascript.com">Don't know how to enable JS?</a></li> <li id="ie">You're using Internet Explorer. Please upgrade to any other browser. <a href="//getfirefox.com">Firefox</a> and <a href="//google.com/chrome">Chrome</a> are both fine options. Nothing will work in IE. I promise.</li> <li id="video">It doesn't seem to support <a href="https://en.wikipedia.org/wiki/HTML5_video">HTML5 video</a>, which means that you won't be able to see any of the videos (obviously). Unless stated below, though, transitions should still work. <a href="http://caniuse.com/#feat=video">You should strongly consider upgrading.</a></li> <li id="audio">It doesn't seem to support <a href="https://en.wikipedia.org/wiki/HTML5_audio">HTML5 audio</a>, which means you won't be able to hear any of the amazing music. <a href="http://caniuse.com/#feat=audio">You should strongly consider upgrading.</a></li> - <li id="opus">It doesn't seem to support the <a href="https://en.wikipedia.org/wiki/Opus_%28audio_codec%29">Opus audio codec</a>, which is much smaller in size. Unless stated above, you should be able to listen to music using an inferior codec.</li> + <li id="opus">It doesn't seem to support the <a href="https://en.wikipedia.org/wiki/Opus_%28audio_codec%29">Opus audio codec</a>, which is much smaller in size than Ogg or MP3. Unless stated above, you should be able to listen to music using an inferior (i.e. uses more bandwidth) codec.</li> <li id="fontface">It doesn't seem to support <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face">the @font-face at-rule</a>, which lets us display the Playtime and Gentium fonts used in Katawa Shoujo. <a href="http://caniuse.com/#feat=fontface">Any browser released in the last 2 years or so should support it.</a></li> <li id="csstransforms">It doesn't seem to support <a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_transforms">CSS transforms</a>, which means that we won't be able to scale the window or show most transitions. <a href="http://caniuse.com/#feat=transforms2d">Any browser released in the last 2 years ago should work.</a></li> </ul> - <div id="gotit" class="button">I know it's broken, let me play!</div> </div> + <p><label class="button"><input type="checkbox" class="option hdisable"> <span class="hdisabled_label">Disable adult content</span></label> + <br> + <div class="button" id="lets-go">Let's go!</div> </div> <div id="container"> <div id="gray" style="display: none;"></div> @@ -61,9 +73,7 @@ <div id="dialogs" class="centered" style="display: none;"> <div id="options"> <h2 class="config_page_caption"></h2> - <label class="button"><input type="checkbox" class="option" id="hdisable"> <span class="hdisabled_label"></span></label> - <label class="button"><input type="checkbox" class="option" id="skipUnread"> <span class="config_skip_unseen_label"></span></label> - <label class="button"><input type="checkbox" class="option" id="skipAfterChoices"> <span class="config_skip_after_choice_label"></span></label> + <label class="button"><input type="checkbox" class="option skipAfterChoices"> <span class="config_skip_after_choice_label"></span></label> <label><input type="range" min="1.0" max="200.0" step="0.001" class="option" id="textSpeed"> <span class="config_textspeed_label"></span></label> <label><input type="range" min="0.0" max="1.0" step="0.001" class="option" id="autoModeDelay"> <span class="config_afmspeed_label"></span></label> @@ -72,6 +82,8 @@ <label><input type="range" min="0.0" max="1.0" step="0.001" class="option" id="sfxVolume"> <span class="config_sfxvol_label"></span> <span id="test-sound" class="button config_sfxtest_label"></span></label> <label class="button disabled config_language_sel"></label> + + <label class="button" id="clear-persistent">Clear persistent data</label> </div> <div id="load_dlg"> <h2 class="load_page_caption"></h2> diff --git a/www/js/api.js b/www/js/api.js index c92d3d7..e88ac91 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -56,7 +56,7 @@ window.html5ks.api = { setTimeout(function () { if (el.src && el.oncanplaythrough) { - console.warn("video not playing after 3 seconds"); + console.warn("media not playing after 3 seconds"); el.oncanplaythrough(); } }, 3000); @@ -77,8 +77,8 @@ window.html5ks.api = { }, play: function (cmd, args) { - var channel = cmd[1]; - this.stop(channel); + var channel = cmd[0]; + this.stop([channel]); var deferred = when.defer(), audio = html5ks.elements.audio[channel]; if (channel === "music" || channel === "ambient") { @@ -98,7 +98,7 @@ window.html5ks.api = { break; case "ambient": case "sound": - src += "sfx/" + html5ks.data.sfx[name]; + src += "sfx/" + html5ks.data.sfx[args.file]; volume = html5ks.persistent.sfxVolume; } @@ -121,18 +121,19 @@ window.html5ks.api = { return deferred.promise; }, - stop: function (channel, ignore, fade) { - if (channel === "all") { + stop: function (cmd, args) { + if (cmd === "all") { return ["music", "sound", "ambient"].forEach(function (channel) { - html5ks.api.stop(channel, ignore, fade); + html5ks.api.stop([channel], args); }); } + var channel = cmd[0]; var audio = html5ks.elements.audio[channel]; if (this._fading[channel]) { clearInterval(this._fading[channel]); } - if (fade) { - this.set_volume(0, fade, channel); + if (args && args.fadeout) { + this.set_volume(0, args.fadeout, channel); } else { audio.pause(); } @@ -203,8 +204,9 @@ window.html5ks.api = { return deferred.promise; }, - _safeCall: function (n, f, args) { - if (f) return f.apply(this, args); + _safeCall: function (obj, key, args) { + console.debug(key, args); + if (obj[key]) return obj[key].apply(obj, args); else { console.error("no such function " + n); debugger; @@ -216,12 +218,12 @@ window.html5ks.api = { runInst: function (inst) { console.debug(inst); var cmd = inst[0].replace(/"/g, ''); - return this._safeCall(cmd, this[cmd], inst.slice(1)); + return this._safeCall(this, cmd, inst.slice(1)); }, UserStatement: function (line, parsed) { - var c = parsed[0][0]; - return this._safeCall(c, this[c], parsed); + console.debug(parsed); + return this._safeCall(this, parsed[0][0], [parsed[0].slice(1)].concat(parsed.slice(1))); }, With: function () { @@ -230,6 +232,7 @@ window.html5ks.api = { window: function (action) { + if (action instanceof Array) action = action[0]; var windw = html5ks.elements.window; switch (action) { case true: @@ -402,11 +405,12 @@ window.html5ks.api = { chr = html5ks.data.characters[who], w = /{w=?(\d*\.\d*)?}(.*)/.exec(what); - if (!chr) { + if (chr) { + chr.what_prefix = chr.what_prefix || "“"; + chr.what_suffix = chr.what_suffix || "“"; + } else { chr = { name: who }; } - chr.what_prefix = chr.what_prefix || "“"; - chr.what_suffix = chr.what_suffix || "“"; this._lastchar = chr; diff --git a/www/js/menu.js b/www/js/menu.js index 25829e1..8539853 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -5,7 +5,7 @@ html5ks.menu = { this.context(false); html5ks.api.stop("all"); html5ks.api.window("hide"); - html5ks.api.play(['', "music"], {file: "music_menus", fadein: 5}); + html5ks.api.play(["music"], {file: "music_menus", fadein: 5}); html5ks.api.Show([['url', 'ui/main/bg-main.png']]); this.elements.mainMenu.style.display = "block"; html5ks.store.status = "menu"; |