From e7e9ae93f2685e844d9f5f28a88b17b357adc5ec Mon Sep 17 00:00:00 2001 From: HyeokjinKang Date: Mon, 8 Jul 2024 03:06:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EA=B2=8C=EC=9E=84=20=ED=94=8C?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=97=90=EC=84=9C=20=ED=82=A4=20=EC=9E=85?= =?UTF-8?q?=EB=A0=A5=EC=9D=B4=20=EC=98=88=EC=83=81=EA=B3=BC=20=EB=8B=A4?= =?UTF-8?q?=EB=A5=B4=EA=B2=8C=20=EB=8F=99=EC=9E=91=ED=95=A0=20=EC=88=98=20?= =?UTF-8?q?=EC=9E=88=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/play.js | 1 + public/js/test.js | 1 + public/js/tutorial.js | 1 + 3 files changed, 3 insertions(+) diff --git a/public/js/play.js b/public/js/play.js index c2698bb..7493fc9 100644 --- a/public/js/play.js +++ b/public/js/play.js @@ -1731,6 +1731,7 @@ document.onkeydown = (e) => { document.onkeyup = (e) => { e = e || window.event; + if (e.repeat) return; let date = Date.now(); const beats = Number((bpmsync.beat + (song.seek() * 1000 - (offset + sync) - bpmsync.ms) / (60000 / bpm)).toPrecision(10)); if (e.key == "Escape") { diff --git a/public/js/test.js b/public/js/test.js index 3e1dfb6..c6ae380 100644 --- a/public/js/test.js +++ b/public/js/test.js @@ -1606,6 +1606,7 @@ const medalCheck = (n) => { document.onkeydown = (e) => { e = e || window.event; + if (e.repeat) return; if (e.key == "Shift") { shiftDown = true; } diff --git a/public/js/tutorial.js b/public/js/tutorial.js index e152c3c..b16ca90 100644 --- a/public/js/tutorial.js +++ b/public/js/tutorial.js @@ -1623,6 +1623,7 @@ const medalCheck = (n) => { document.onkeydown = (e) => { e = e || window.event; + if (e.repeat) return; if (e.key == "Shift") { shiftDown = true; } From e163709ae309ca6533e29c522597cc57ad682ae0 Mon Sep 17 00:00:00 2001 From: HyeokjinKang Date: Mon, 8 Jul 2024 03:07:38 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20retry=EB=A5=BC=202=ED=9A=8C=20?= =?UTF-8?q?=EC=9D=B4=EC=83=81=20=ED=98=B8=EC=B6=9C=ED=95=98=EB=A9=B4=20bac?= =?UTF-8?q?kup=EC=9D=B4=20=EC=98=A4=EC=97=BC=EB=90=98=EB=8A=94=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/play.js | 2 +- public/js/test.js | 4 +--- public/js/tutorial.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/public/js/play.js b/public/js/play.js index 7493fc9..9158c44 100644 --- a/public/js/play.js +++ b/public/js/play.js @@ -1545,7 +1545,7 @@ const retry = () => { blackOverlayContainer.classList.add("show"); setTimeout(() => { song.stop(); - pattern = patternBackup; + pattern = JSON.parse(JSON.stringify(patternBackup)); bpm = pattern.information.bpm; speed = pattern.information.speed; bpmsync = { diff --git a/public/js/test.js b/public/js/test.js index c6ae380..00c0dac 100644 --- a/public/js/test.js +++ b/public/js/test.js @@ -14,7 +14,6 @@ const ctx = canvas.getContext("2d"); const missCanvas = document.getElementById("missPointCanvas"); const missCtx = missCanvas.getContext("2d"); let pattern = {}; -let patternBackup = {}; let patternLength = 0; let settings, sync, song, tracks, pixelRatio, offset, bpm, speed; let bpmsync = { @@ -163,7 +162,6 @@ const initialize = (isFirstCalled) => { missCanvas.height = window.innerHeight * 0.05 * pixelRatio; if (isFirstCalled) { pattern = JSON.parse(localStorage.pattern); - patternBackup = JSON.parse(localStorage.pattern); patternLength = pattern.patterns.length; document.getElementById("artist").textContent = pattern.information.producer; document.getElementById("scoreArtist").textContent = pattern.information.producer; @@ -1449,7 +1447,7 @@ const retry = () => { blackOverlayContainer.classList.add("show"); setTimeout(() => { song.stop(); - pattern = patternBackup; + pattern = JSON.parse(localStorage.pattern); bpm = pattern.information.bpm; speed = pattern.information.speed; bpmsync = { diff --git a/public/js/tutorial.js b/public/js/tutorial.js index b16ca90..d0f31be 100644 --- a/public/js/tutorial.js +++ b/public/js/tutorial.js @@ -1449,7 +1449,7 @@ const retry = () => { blackOverlayContainer.classList.add("show"); setTimeout(() => { song.stop(); - pattern = patternBackup; + pattern = JSON.parse(JSON.stringify(patternBackup)); bpm = pattern.information.bpm; speed = pattern.information.speed; bpmsync = {