From d7a56f1dbd3169280efc921e5b8ee28964b767ef Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:46:03 -0700 Subject: [PATCH] add undo to create strumline --- source/funkin/editors/charter/Charter.hx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 31647f08..afaf9fbb 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -695,9 +695,10 @@ class Charter extends UIState { // STRUMLINE DELETION/CREATION public function createStrumline(strumLineID:Int, strL:ChartStrumLine, addToUndo:Bool = true) { + selection = []; // dont fuck with selected notes + var cStr = new CharterStrumline(strL); strumLines.insert(strumLineID, cStr); - selection = []; // Push forward notes that are infront of the strumLine for (note in notesGroup.members) { @@ -712,12 +713,16 @@ class Charter extends UIState { notesGroup.add(n); } sortNotes(); + + if (addToUndo) + this.addToUndo(CCreateStrumLine(strumLineID, strL)); } public function deleteStrumline(strumLineID:Int, addToUndo:Bool = true) { + selection = []; // dont fuck with selected notes + var strL = strumLines.members[strumLineID].strumLine; strumLines.members.remove(strumLines.members[strumLineID]); - selection = []; var deletedstrumNotes:Array = []; // Delete this strums notes