From 5acc8806fed6549570facf33e70085178907b8fc Mon Sep 17 00:00:00 2001 From: William Toohey Date: Wed, 23 Sep 2015 23:34:48 +1000 Subject: [PATCH] Minor cleanups, add favicon --- favicon.ico | Bin 0 -> 1150 bytes js/HuesCanvas.js | 5 ++--- js/HuesCore.js | 12 ++++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 favicon.ico diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..cb01422a4f5fe307a87d2fb0975b440ee4cd41b5 GIT binary patch literal 1150 zcmb_bJ!m3P5Z;4>w5hHzAlG>)R;IEF>5>o-I|KG-;ZGGoFc7Q)sVovfG>Cw@_HF8ur| z2;T%j_#sXa5|Q7y_z|{5-}`|-V>B8;^dS%ktRO5F3*6n^q2KRgI-N4!?RF*q`-Ru* z#d5i1I3AC4zTt4l{9dnzr>7^py}iAs$?U;kfXQTn)6-MtQ%zS_S9pDWmBoE#9334o z|KQ*N^ZA^^srK1y_8AqmT8+7zo10Q>r_%vxcz%ACu#XnaW>c!W)oQU8ilbgWK0e~% z;X$hBBR=WX>2%oM-e%3z_m`I!DU>w)try3~$Jp4|fWzV78t(7!SoMx)_8DwPUqwHoK==TIt@@OV5>C=_V7+fq%mh(sdHTU%R$%jJ@K zu(Pv+d_Ire-Cbz4T3D@C_N7uO8Q<-8Gw%2M;dDA-u~=X*7+^A)kWQze*Xv<6o7pxR zjR=RsGJZ0d1f3UY%VaW0Boa6|IbjX;dL1^KjcwW|6bj+y=0?V+n)mnjQ7)HJtyXzn zTwEX;jiOSiAQ%j?j#8-vs&RFvR!QiN+U<6not?qw^Px~EAQp>p9?E%nc?sg?ayg90 l;}uQzrGJg~BE5}9gZCp{l&4rM;`;hp7XLpC@vQ%8`~pY^Kt})o literal 0 HcmV?d00001 diff --git a/js/HuesCanvas.js b/js/HuesCanvas.js index 9cd0d32..4f9cb22 100644 --- a/js/HuesCanvas.js +++ b/js/HuesCanvas.js @@ -226,7 +226,7 @@ HuesCanvas.prototype.doBlackout = function(whiteout) { this.blackout = true; this.needsRedraw = true; if(localStorage["blackoutUI"] == "on") { - core.userInterface.hide(); + this.core.userInterface.hide(); } } @@ -236,13 +236,12 @@ HuesCanvas.prototype.clearBlackout = function() { this.blackoutTimeout = 0; this.needsRedraw = true; if(localStorage["blackoutUI"] == "on") { - core.userInterface.show(); + this.core.userInterface.show(); } } HuesCanvas.prototype.doShortBlackout = function(beatTime) { this.doBlackout(); - // GetRandomWaifu(); TODO IMPLEMENT IN CORE INSTEAD this.blackoutTimeout = this.aContext.currentTime + beatTime / 1.7; // looks better if we go right to black this.blackoutStart = 0; diff --git a/js/HuesCore.js b/js/HuesCore.js index 9a22a2a..ef88b90 100644 --- a/js/HuesCore.js +++ b/js/HuesCore.js @@ -60,7 +60,8 @@ HuesCore = function(defaults) { document.onkeydown = function(e){ e = e || window.event; // Ignore modifiers so we don't steal other events - if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) { + // Shift is actually used, and is thus ignored here + if (e.altKey || e.ctrlKey || e.metaKey) { return true; } var key = e.keyCode || e.which; @@ -486,8 +487,15 @@ HuesCore.prototype.settingsUpdated = function() { this.colours = this.weedColours; break; } - if(localStorage["blackoutUI"] == "on") { + switch (localStorage["blackoutUI"]) { + case "off": this.userInterface.show(); + break; + case "on": + if(this.renderer.blackout) { + this.userInterface.hide(); + } + break; } /*if (this.autoSong == "off" && !(this.settings.autosong == "off")) { console.log("Resetting loopCount since AutoSong was enabled");