From f11c821cbf21b4d076bcd3acc4b3617932721008 Mon Sep 17 00:00:00 2001 From: lunarcleint Date: Tue, 4 Mar 2025 20:03:06 -0700 Subject: [PATCH] Editor selections resolution aware!! --- source/funkin/editors/EditorTreeMenu.hx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/funkin/editors/EditorTreeMenu.hx b/source/funkin/editors/EditorTreeMenu.hx index 543b0555..a35bdd98 100644 --- a/source/funkin/editors/EditorTreeMenu.hx +++ b/source/funkin/editors/EditorTreeMenu.hx @@ -11,6 +11,8 @@ class EditorTreeMenu extends TreeMenu { public override function create() { super.create(); + UIState.setResolutionAware(); + FlxG.camera.fade(0xFF000000, 0.5, true); bg = new FlxBackdrop(); @@ -23,6 +25,18 @@ class EditorTreeMenu extends TreeMenu { FlxG.switchState(new MainMenuState()); } + public override function onResize(width:Int, height:Int) { + super.onResize(width, height); + if (!UIState.resolutionAware) return; + + if (width < FlxG.initialWidth || height < FlxG.initialHeight) { + width = FlxG.initialWidth; height = FlxG.initialHeight; + } + + if (pathDesc != null && pathLabel != null) + pathDesc.width = pathLabel.width = width - 8; + } + public override function update(elapsed:Float) { super.update(elapsed); bg.x += elapsed * 125;