Merge pull request #142 from FunkinCrew/bugfix/chart-editor-playbar-buttons

Fixed a bug where the playbar buttons wouldn't work
This commit is contained in:
Cameron Taylor 2023-09-13 00:09:37 -04:00 committed by GitHub
commit 5d7efcd6b9

View file

@ -1873,14 +1873,21 @@ class ChartEditorState extends HaxeUIState
**/ **/
function handleScrollKeybinds():Void function handleScrollKeybinds():Void
{ {
// Don't scroll when the cursor is over the UI. // Don't scroll when the cursor is over the UI, unless a playbar button (the << >> ones) is pressed.
if (isCursorOverHaxeUI) return; if (isCursorOverHaxeUI && playbarButtonPressed == null) return;
var scrollAmount:Float = 0; // Amount to scroll the grid. var scrollAmount:Float = 0; // Amount to scroll the grid.
var playheadAmount:Float = 0; // Amount to scroll the playhead relative to 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 shouldPause:Bool = false; // Whether to pause the song when scrolling.
var shouldEase:Bool = false; // Whether to ease the scroll. 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 // Up Arrow = Scroll Up
if (upKeyHandler.activated && currentLiveInputStyle != LiveInputStyle.WASD) if (upKeyHandler.activated && currentLiveInputStyle != LiveInputStyle.WASD)
{ {
@ -1940,13 +1947,6 @@ class ChartEditorState extends HaxeUIState
shouldPause = true; 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. // Middle Mouse + Drag = Scroll but move the playhead the same amount.
if (FlxG.mouse.pressedMiddle) if (FlxG.mouse.pressedMiddle)
{ {