From d9815aeafb30fc4c8497fa3ccb76e270f8ebba6e Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Mon, 18 Oct 2021 07:04:25 +0000 Subject: [PATCH] Iterate through all lanes when adding a note to see if it matches another hold note. Co-authored-by: sigonasr2 --- LLSIG/src/main/java/LLSIG/Lane.java | 31 +++++++++++++++++++++++++++++ LLSIG/src/main/java/LLSIG/Note.java | 1 + 2 files changed, 32 insertions(+) diff --git a/LLSIG/src/main/java/LLSIG/Lane.java b/LLSIG/src/main/java/LLSIG/Lane.java index 244b55d..fd4357b 100644 --- a/LLSIG/src/main/java/LLSIG/Lane.java +++ b/LLSIG/src/main/java/LLSIG/Lane.java @@ -65,6 +65,37 @@ public class Lane{ break; } } + for (Lane l : LLSIG.game.lanes) { + if (l!=this) { + for (Note nn : l.noteChart) { + if (nn.start==n.start) { + nn.multiple=true; + n.multiple=true; + } + if (n.getNoteType()==NoteType.HOLD) { + if (nn.getNoteType()==NoteType.HOLD) { + if (n.start==nn.end) { + nn.multiple2=true; + n.multiple=true; + } + if (n.end==nn.start) { + nn.multiple=true; + n.multiple2=true; + } else + if (n.end==nn.end) { + nn.multiple2=true; + n.multiple2=true; + } + } else { + if (n.end==nn.start) { + nn.multiple=true; + n.multiple2=true; + } + } + } + } + } + } if (!added) { noteChart.add(n); } diff --git a/LLSIG/src/main/java/LLSIG/Note.java b/LLSIG/src/main/java/LLSIG/Note.java index 541dd8e..d427151 100644 --- a/LLSIG/src/main/java/LLSIG/Note.java +++ b/LLSIG/src/main/java/LLSIG/Note.java @@ -8,6 +8,7 @@ public class Note { double beatSnapStart,beatSnapEnd = -1; boolean deleted=false; //Set this marker to delete it on the next frame (when using the editor) boolean multiple=false; //Whether or not to display an indicator showing this is a multi-press note. + boolean multiple2=false; //Whether or not to display an indicator showing this is a multi-press note for the ending of the hold. public Note(NoteType type,double start,double end) { this.type=type; this.start=start;