Update UIWindow.hx

the titlebar couldn't be null because it was an optional parameter, also checking string length
This commit is contained in:
Jade
2025-05-20 17:36:15 -04:00
committed by GitHub
parent ccd1515040
commit 6c783cc20a
+3 -3
View File
@@ -5,10 +5,10 @@ class UIWindow extends UISliceSprite {
public var collapsable:Bool = false;
public var content:FlxTypedGroup<FlxBasic>;
public override function new(x:Float, y:Float, w:Int, h:Int, title:String) {
public override function new(x:Float, y:Float, w:Int, h:Int, ?title:String) {
super(x, y, w, h, "editors/ui/normal-popup");
if(title != null) {
if(title != null && title.length != 0) {
members.push(titleSpr = new UIText(x + 25, y, bWidth - 50, title, 15, -1));
titleSpr.y = y + ((30 - titleSpr.height) / 2);
}
@@ -47,4 +47,4 @@ class UIWindow extends UISliceSprite {
}
hovered = content.exists && UIState.state.isOverlapping(this, __rect);
}
}
}