From e0963c5f0a57964d94e1f2b7c60dc87369319cd6 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Tue, 25 Jul 2023 16:18:52 -0700 Subject: [PATCH] Cut is back --- source/funkin/editors/charter/Charter.hx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 2a6a1ead..1c3fd716 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -157,6 +157,11 @@ class Charter extends UIState { onSelect: _edit_paste }, null, + { + label: "Cut", + keybind: [CONTROL, X], + onSelect: _edit_cut + }, { label: "Delete", keybind: [DELETE], @@ -990,12 +995,19 @@ class Charter extends UIState { } } selection = sObjects; - trace(sObjects); - addToUndo(CCreateSelection(sObjects.copy())); + addToUndo(CCreateSelection(sObjects)); + } + + function _edit_cut(_) { + if (selection == null || selection.length == 0) return; + + _edit_copy(_); + deleteSelection(selection, false); + selection = []; } function _edit_delete(_) { - if (selection == null) return; + if (selection == null || selection.length == 0) return; selection = deleteSelection(selection); }