From bc5b34cdd2e26bf4b122ca83c7cc9ab3181f5cc4 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 31 Aug 2023 19:14:01 -0400 Subject: [PATCH] Fixed a bug where the playbar buttons wouldn't work while the cursor was over the UI. --- .../ui/debug/charting/ChartEditorState.hx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 83c052050..84e3caba1 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -1846,14 +1846,21 @@ class ChartEditorState extends HaxeUIState **/ function handleScrollKeybinds():Void { - // Don't scroll when the cursor is over the UI. - if (isCursorOverHaxeUI) return; + // Don't scroll when the cursor is over the UI, unless a playbar button (the << >> ones) is pressed. + if (isCursorOverHaxeUI && playbarButtonPressed == null) return; var scrollAmount:Float = 0; // Amount to scroll the grid. var playheadAmount:Float = 0; // Amount to scroll the playhead relative to the grid. var shouldPause:Bool = false; // Whether to pause the song when scrolling. var shouldEase:Bool = false; // Whether to ease the scroll. + // Mouse Wheel = Scroll + if (FlxG.mouse.wheel != 0 && !FlxG.keys.pressed.CONTROL) + { + scrollAmount = -10 * FlxG.mouse.wheel; + shouldPause = true; + } + // Up Arrow = Scroll Up if (upKeyHandler.activated && currentLiveInputStyle != LiveInputStyle.WASD) { @@ -1909,13 +1916,6 @@ class ChartEditorState extends HaxeUIState shouldPause = true; } - // Mouse Wheel = Scroll - if (FlxG.mouse.wheel != 0 && !FlxG.keys.pressed.CONTROL) - { - scrollAmount = -10 * FlxG.mouse.wheel; - shouldPause = true; - } - // Middle Mouse + Drag = Scroll but move the playhead the same amount. if (FlxG.mouse.pressedMiddle) {