Files
CodenameEngine/source/funkin/backend/utils/WindowUtils.hx
T
lunarcleint 014be749e6 Squashed commit of the following:
commit 4987983dc6e655183b34258fed905be2fba73e0a
Author: lunarcleint <88809950+lunarcleint@users.noreply.github.com>
Date:   Mon Apr 1 06:32:22 2024 -0700

    fix charter bug

commit 1135b53d4d4ab48fb74a9d5693579d0a2e4923db
Author: lunarcleint <88809950+lunarcleint@users.noreply.github.com>
Date:   Mon Apr 1 00:46:53 2024 -0700

    small changes

commit 102931f3511c9f0423cf887ebf91eaeeb1024abe
Author: lunarcleint <88809950+lunarcleint@users.noreply.github.com>
Date:   Sun Mar 31 23:03:03 2024 -0700

    update spelling mistakes

commit 87ad53ae91bc8b4d3b49af3ebb8c07db9f13765b
Author: lunarcleint <88809950+lunarcleint@users.noreply.github.com>
Date:   Sun Mar 31 22:40:48 2024 -0700

    Chart editor updates

commit 8f7cae8a80a681158ff125c3e2547c9fd4dee7c1
Author: NeeEoo <NeeEoo@users.noreply.github.com>
Date:   Mon Apr 1 07:03:30 2024 +0200

    Redesigned Chart Editor

commit dbb94ba3bd8455a91883d6e5b59b25da87aefa32
Author: NeeEoo <NeeEoo@users.noreply.github.com>
Date:   Mon Apr 1 02:20:57 2024 +0200

    Added Stage Editor
2024-04-01 06:44:28 -07:00

66 lines
1.7 KiB
Haxe

package funkin.backend.utils;
import flixel.text.Uwuifier;
import openfl.Lib;
class WindowUtils {
public static var winTitle(default, set):String;
private static function set_winTitle(value:String):String {
winTitle = value;
updateTitle();
return value;
}
public static var prefix(default, set):String = "";
private static function set_prefix(value:String):String {
prefix = value;
updateTitle();
return value;
}
public static var suffix(default, set):String = "";
private static function set_suffix(value:String):String {
suffix = value;
updateTitle();
return value;
}
public static var preventClosing:Bool = true;
public static var onClosing:Void->Void;
static var __triedClosing:Bool = false;
public static inline function resetClosing() __triedClosing = false;
public static inline function init() {
resetTitle();
resetClosing();
Lib.application.window.onClose.add(function () {
if (preventClosing && !__triedClosing) {
Lib.application.window.onClose.cancel();
__triedClosing = true;
}
if (onClosing != null) onClosing();
});
}
public static inline function resetTitle() {
winTitle = Lib.application.meta["name"];
resetAffixes();
}
public static inline function resetAffixes() {
prefix = suffix = "";
updateTitle();
}
public static inline function updateTitle()
Lib.application.window.title = Uwuifier.uwuifySentence('$prefix$winTitle$suffix');
// backwards compat
@:noCompletion public static var endfix(get, set):String;
@:noCompletion private static function set_endfix(value:String):String {
return suffix = value;
}
@:noCompletion private static function get_endfix():String {
return suffix;
}
}