From 1fafc96509395a81a8ac28faa7893a0fb37b8103 Mon Sep 17 00:00:00 2001 From: lunarcleint <88809950+lunarcleint@users.noreply.github.com> Date: Thu, 21 Mar 2024 13:53:15 -0700 Subject: [PATCH] FIX DUMB BUG WITH BUTTONS --- source/funkin/editors/charter/Charter.hx | 2 +- source/funkin/editors/charter/CharterStrumlineButton.hx | 4 ++-- source/funkin/editors/ui/UIContextMenu.hx | 2 +- source/funkin/editors/ui/UITopMenu.hx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 704433ba..100209e8 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -432,7 +432,7 @@ class Charter extends UIState { } quants.reverse(); - strumlineInfoBG = new UISprite(); + strumlineInfoBG = new FlxSprite(); strumlineInfoBG.loadGraphic(Paths.image('editors/charter/strumline-info-bg')); strumlineInfoBG.y = 23; strumlineInfoBG.scrollFactor.set(); diff --git a/source/funkin/editors/charter/CharterStrumlineButton.hx b/source/funkin/editors/charter/CharterStrumlineButton.hx index b132dab1..c5619330 100644 --- a/source/funkin/editors/charter/CharterStrumlineButton.hx +++ b/source/funkin/editors/charter/CharterStrumlineButton.hx @@ -59,9 +59,9 @@ class CharterStrumlineButton extends UISprite { super.update(elapsed); UIState.state.updateSpriteRect(button); - if(UIState.state.isOverlapping(button, button.__rect)) { + if(UIState.state.curContextMenu == null && UIState.state.isOverlapping(button, button.__rect)) { buttonScale.set(0.95, 0.95); - if (FlxG.mouse.justReleased && onClick != null) { + if (FlxG.mouse.justPressed && onClick != null) { onClick(); if (animationOnClick) pressAnimation(); } diff --git a/source/funkin/editors/ui/UIContextMenu.hx b/source/funkin/editors/ui/UIContextMenu.hx index d10b3fd9..a7261389 100644 --- a/source/funkin/editors/ui/UIContextMenu.hx +++ b/source/funkin/editors/ui/UIContextMenu.hx @@ -96,7 +96,7 @@ class UIContextMenu extends MusicBeatSubstate { } public override function update(elapsed:Float) { - if (__oobDeletion && FlxG.mouse.justPressed && !bg.hoveredByChild) + if (__oobDeletion && FlxG.mouse.justReleased && !bg.hoveredByChild) close(); __oobDeletion = true; diff --git a/source/funkin/editors/ui/UITopMenu.hx b/source/funkin/editors/ui/UITopMenu.hx index ae78469d..4810362d 100644 --- a/source/funkin/editors/ui/UITopMenu.hx +++ b/source/funkin/editors/ui/UITopMenu.hx @@ -65,7 +65,7 @@ class UITopMenuButton extends UISliceSprite { var opened = curMenu != null ? curMenu.contextMenuOpened() : false; - if(opened && FlxG.mouse.justPressed) { + if(opened && FlxG.mouse.justReleased) { __rect.x = x; __rect.y = y; __rect.width = bWidth;