From 2b47f820585b053d1b3598a04fabce9a5a6a69fd Mon Sep 17 00:00:00 2001 From: TheZoroForce240 <86524550+TheZoroForce240@users.noreply.github.com> Date: Sat, 25 Apr 2026 09:21:03 +0100 Subject: [PATCH] add global uistate fallback to allow scripting in non uistates --- source/funkin/editors/ui/UIState.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/funkin/editors/ui/UIState.hx b/source/funkin/editors/ui/UIState.hx index f7db06b153..08a7daa6fb 100644 --- a/source/funkin/editors/ui/UIState.hx +++ b/source/funkin/editors/ui/UIState.hx @@ -18,9 +18,11 @@ class UIState extends MusicBeatState { public var curContextMenu:UIContextMenu = null; public static var state(get, never):UIState; + + public static var fallbackState:UIState = null; private inline static function get_state() - return FlxG.state is UIState ? cast FlxG.state : null; + return FlxG.state is UIState ? cast FlxG.state : fallbackState; public var buttonHandler:Void->Void = null; public var hoveredSprite:UISprite = null;