From 4a3675a97c5a4f2882dec43a499bb5ec7fd87368 Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Sat, 27 Oct 2018 22:53:47 +0300 Subject: [PATCH 1/2] Hide barlines when they should be hidden --- public/src/js/parsetja.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/src/js/parsetja.js b/public/src/js/parsetja.js index 8e9220e..8845838 100644 --- a/public/src/js/parsetja.js +++ b/public/src/js/parsetja.js @@ -154,6 +154,8 @@ }) } } + }else{ + firstMeasure = false } if(currentMeasure.length){ for(var i = 0; i < currentMeasure.length; i++){ From 73e7d384cd53c8af19caef01058583a994269cab Mon Sep 17 00:00:00 2001 From: LoveEevee Date: Sat, 27 Oct 2018 23:42:02 +0300 Subject: [PATCH 2/2] Remove measures before first one, fix debug mouse events --- public/src/js/parsetja.js | 14 -------------- public/src/js/songselect.js | 6 +++--- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/public/src/js/parsetja.js b/public/src/js/parsetja.js index 8845838..f739578 100644 --- a/public/src/js/parsetja.js +++ b/public/src/js/parsetja.js @@ -125,7 +125,6 @@ var branchPreference = "m" var currentMeasure = [] - var firstMeasure = true var firstNote = true var circles = [] var circleID = 0 @@ -143,19 +142,6 @@ originalMS: ms, speed: speed }) - if(firstMeasure){ - firstMeasure = false - var msPerMeasure = 60000 * measure / bpm - for(var measureMs = ms - msPerMeasure; measureMs > 0; measureMs -= msPerMeasure){ - this.measures.push({ - ms: measureMs, - originalMS: ms, - speed: speed - }) - } - } - }else{ - firstMeasure = false } if(currentMeasure.length){ for(var i = 0; i < currentMeasure.length; i++){ diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index f0dc2b6..e5da1a1 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -243,8 +243,8 @@ class SongSelect{ this.startP2() pageEvents.keyAdd(this, "all", "down", this.keyDown.bind(this)) - pageEvents.add(window, "mousemove", this.mouseMove.bind(this)) - pageEvents.add(window, ["mousedown", "touchstart"], this.mouseDown.bind(this)) + pageEvents.add(loader.screen, "mousemove", this.mouseMove.bind(this)) + pageEvents.add(loader.screen, ["mousedown", "touchstart"], this.mouseDown.bind(this)) if(touchEnabled && fullScreenSupported){ this.touchFullBtn = document.getElementById("touch-full-btn") this.touchFullBtn.style.display = "block" @@ -1459,7 +1459,7 @@ class SongSelect{ this.redrawRunning = false this.endPreview() pageEvents.keyRemove(this, "all") - pageEvents.remove(window, ["mousemove", "mousedown", "touchstart"]) + pageEvents.remove(loader.screen, ["mousemove", "mousedown", "touchstart"]) if(this.touchEnabled && fullScreenSupported){ pageEvents.remove(this.touchFullBtn, "click") delete this.touchFullBtn