Warning shit added
This commit is contained in:
+18
-2
@@ -2,7 +2,7 @@ package funkin.backend.utils;
|
||||
|
||||
import openfl.Lib;
|
||||
|
||||
class WindowTitle {
|
||||
class WindowUtils {
|
||||
public static var winTitle(default, set):String;
|
||||
public static function set_winTitle(newWinTitle:String):String {
|
||||
winTitle = newWinTitle;
|
||||
@@ -22,9 +22,25 @@ class WindowTitle {
|
||||
return endPrefix;
|
||||
}
|
||||
|
||||
public static inline function init()
|
||||
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() {
|
||||
reset();
|
||||
|
||||
Lib.application.window.onClose.add(function () {
|
||||
if (preventClosing && !__triedClosing) {
|
||||
Lib.application.window.onClose.cancel();
|
||||
__triedClosing = true;
|
||||
}
|
||||
if (onClosing != null) onClosing();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public static inline function reset() {
|
||||
winTitle = Lib.application.meta["name"];
|
||||
prefix = endfix = "";
|
||||
Reference in New Issue
Block a user