Files
TheZoroForce240andGitHub 4fe3ba76e3 Charter/Editor additions and fixes (#793)
* camera highlights again

* option to mute all hitsounds

* context menus inside context menus and wip sliders in context menu

* wip volume slider stuff

* strumline preview fix with resizable editors

* more slider stuff

* editor sfx option should now actually work for everything

* fixed strumline vocals volume, fixed note type option keybinds and moved bookmarks and note types into submenus

* fix for saving difficulty specific meta json

* some extra misc changes

fixed camera highlights not updating when zooming in/out, optimized some of the highlight draw code so it doesn't do a full loop, and added the note scale flag into the strumline preview

* fix compiling after merge
2026-03-01 21:13:33 +07:00

52 lines
1.2 KiB
Haxe

package funkin.editors.ui;
class UIWindow extends UISliceSprite {
public var titleSpr:UIText;
public var collapsable:Bool = false;
public var content:FlxTypedGroup<FlxBasic>;
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 && title.length != 0) {
members.push(titleSpr = new UIText(x + 25, y, bWidth - 50, title, 15, -1));
titleSpr.y = y + ((30 - titleSpr.height) / 2);
}
content = new FlxTypedGroup<FlxBasic>();
members.push(content);
UIState.playEditorSound(Flags.DEFAULT_EDITOR_WINDOWAPPEAR_SOUND);
}
public override function update(elapsed:Float) {
super.update(elapsed);
cursor = ARROW;
if(collapsable) {
__rect.set(x, y, bWidth, topHeight);
if(UIState.state.isOverlapping(this, __rect)) {
cursor = CLICK;
if(FlxG.mouse.justPressed) {
content.exists = !content.exists;
drawMiddle = !drawMiddle;
drawBottom = !drawBottom;
}
} else {
if(!content.exists) {
cursor = null;
}
}
}
__rect.x = x;
__rect.width = bWidth;
if(content.exists) {
__rect.y = y+topHeight;
__rect.height = bHeight-topHeight;
}
hovered = content.exists && UIState.state.isOverlapping(this, __rect);
}
}