From 912907cb1b556e7006ba3f88c3b2bd0a26312417 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Wed, 13 Oct 2021 04:50:07 +0000 Subject: [PATCH] Handle hold note judgement endings. Fix rendering and removed unnecessary note removal Co-authored-by: sigonasr2 --- LLSIG/src/main/java/LLSIG/Canvas.java | 2 +- LLSIG/src/main/java/LLSIG/LLSIG.java | 14 +++++++++----- LLSIG/src/main/java/LLSIG/Lane.java | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/LLSIG/src/main/java/LLSIG/Canvas.java b/LLSIG/src/main/java/LLSIG/Canvas.java index 408ffae..a08a557 100644 --- a/LLSIG/src/main/java/LLSIG/Canvas.java +++ b/LLSIG/src/main/java/LLSIG/Canvas.java @@ -162,7 +162,7 @@ public class Canvas extends JPanel implements AudioSpectrumListener{ int noteCounter = 0; while (lane.noteExists(noteCounter)) { Note n = lane.getNote(noteCounter); - if (n.active) { + if (n.active||n.active2) { double PLAYTIME_RATIO = (1-(((double)n.getStartFrame()-LLSIG.game.musicPlayer.getPlayPosition())/LLSIG.game.NOTE_SPEED)); double PLAYTIME_END_RATIO = (1-(((double)n.getEndFrame()-LLSIG.game.musicPlayer.getPlayPosition())/LLSIG.game.NOTE_SPEED)); if (n.getNoteType()==NoteType.HOLD) { diff --git a/LLSIG/src/main/java/LLSIG/LLSIG.java b/LLSIG/src/main/java/LLSIG/LLSIG.java index 91e836e..6978f4a 100644 --- a/LLSIG/src/main/java/LLSIG/LLSIG.java +++ b/LLSIG/src/main/java/LLSIG/LLSIG.java @@ -346,11 +346,6 @@ public class LLSIG implements KeyListener{ if (l.noteExists()) { Note n = l.getNote(); double diff = n.getStartFrame()-LLSIG.game.musicPlayer.getPlayPosition(); - double diff2 = n.getEndFrame()-LLSIG.game.musicPlayer.getPlayPosition(); - if (n.getNoteType()==NoteType.HOLD&&n.active2&&!n.active&&diff2<=BAD_TIMING_WINDOW) { - judgeNote(l, diff2); - n.active2=false; - } if (n.active&&diff<=BAD_TIMING_WINDOW) { judgeNote(l, diff); n.active=false; @@ -397,6 +392,15 @@ public class LLSIG implements KeyListener{ } if (lane!=-1) { keyState[lane]=false; + Lane l = lanes.get(lane); + if (l.noteExists()) { + Note n = l.getNote(); + double diff2 = n.getEndFrame()-LLSIG.game.musicPlayer.getPlayPosition(); + if (n.getNoteType()==NoteType.HOLD&&n.active2&&!n.active&&diff2<=BAD_TIMING_WINDOW) { + judgeNote(l, diff2); + n.active2=false; + } + } } } } diff --git a/LLSIG/src/main/java/LLSIG/Lane.java b/LLSIG/src/main/java/LLSIG/Lane.java index 6350caf..7d019fc 100644 --- a/LLSIG/src/main/java/LLSIG/Lane.java +++ b/LLSIG/src/main/java/LLSIG/Lane.java @@ -26,7 +26,7 @@ public class Lane{ for (int i=noteOffset;i