fix deleting not removing selected boxes

This commit is contained in:
KadeDeveloper 2021-08-13 14:54:26 -07:00
parent 5f8ca9beb4
commit b749f10957

View File

@ -2719,6 +2719,7 @@ class ChartingState extends MusicBeatState
var box = new ChartingBox(note.x,note.y,note); var box = new ChartingBox(note.x,note.y,note);
box.connectedNoteData = i; box.connectedNoteData = i;
selectedBoxes.add(box); selectedBoxes.add(box);
note.charterSelected = true;
curSelectedNoteObject.charterSelected = true; curSelectedNoteObject.charterSelected = true;
} }
@ -2763,18 +2764,14 @@ class ChartingState extends MusicBeatState
if (note.sustainLength > 0) if (note.sustainLength > 0)
curRenderedSustains.remove(note.noteCharterObject); curRenderedSustains.remove(note.noteCharterObject);
if (note.charterSelected) for(i in 0...selectedBoxes.members.length)
{ {
note.charterSelected = false; var box = selectedBoxes.members[i];
for(i in 0...selectedBoxes.members.length) if (box.connectedNote == note)
{ {
var box = selectedBoxes.members[i]; selectedBoxes.members.remove(box);
if (box.connectedNote == note) box.destroy();
{ return;
selectedBoxes.members.remove(box);
box.destroy();
return;
}
} }
} }
} }