From e2c92e664cb8d421092ee1b9464e6087805481a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sun, 24 Mar 2024 23:00:44 +0100 Subject: [PATCH] bugfix for uicontext menus' undos redos --- source/funkin/editors/charter/Charter.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index a26c55c0..a2293fd4 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -827,10 +827,10 @@ class Charter extends UIState { if (FlxG.mouse.justPressed) FlxG.mouse.getWorldPosition(charterCamera, dragStartPos); else if (FlxG.mouse.justPressedRight) { - closeCurrentContextMenu(); + closeCurrentContextMenu(); gridActionType = DELETE_SELECTION; } - + if (gridBackdropDummy.hovered) { // AUTO DETECT if (FlxG.mouse.pressed && (Math.abs(mousePos.x - dragStartPos.x) > 20 || Math.abs(mousePos.y - dragStartPos.y) > 20)) @@ -1431,7 +1431,7 @@ class Charter extends UIState { } function _edit_undo(_) { - if (strumLines.isDragging || selectionDragging || subState != null) return; + if (strumLines.isDragging || selectionDragging || (subState != null && !(subState is UIContextMenu))) return; selection = []; var undo = undos.undo(); @@ -1477,7 +1477,7 @@ class Charter extends UIState { } function _edit_redo(_) { - if (strumLines.isDragging || selectionDragging || subState != null) return; + if (strumLines.isDragging || selectionDragging || (subState != null && !(subState is UIContextMenu))) return; selection = []; var redo = undos.redo();