Iterate through all lanes when adding a note to see if it matches another hold note.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2, Sig, Sigo 2021-10-18 07:04:25 +00:00
parent 3ca3168f30
commit d9815aeafb
2 changed files with 32 additions and 0 deletions

View File

@ -65,6 +65,37 @@ public class Lane{
break; 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) { if (!added) {
noteChart.add(n); noteChart.add(n);
} }

View File

@ -8,6 +8,7 @@ public class Note {
double beatSnapStart,beatSnapEnd = -1; double beatSnapStart,beatSnapEnd = -1;
boolean deleted=false; //Set this marker to delete it on the next frame (when using the editor) 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 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) { public Note(NoteType type,double start,double end) {
this.type=type; this.type=type;
this.start=start; this.start=start;