WindowUtil.resetAffixes + typo fix
This commit is contained in:
@@ -4,22 +4,22 @@ import openfl.Lib;
|
||||
|
||||
class WindowUtils {
|
||||
public static var winTitle(default, set):String;
|
||||
public static function set_winTitle(newWinTitle:String):String {
|
||||
winTitle = newWinTitle;
|
||||
private static function set_winTitle(value:String):String {
|
||||
winTitle = value;
|
||||
updateTitle();
|
||||
return newWinTitle;
|
||||
return value;
|
||||
}
|
||||
public static var prefix(default, set):String = "";
|
||||
public static function set_prefix(newPrefix:String):String {
|
||||
prefix = newPrefix;
|
||||
private static function set_prefix(value:String):String {
|
||||
prefix = value;
|
||||
updateTitle();
|
||||
return newPrefix;
|
||||
return value;
|
||||
}
|
||||
public static var endfix(default, set):String = "";
|
||||
public static function set_endfix(endPrefix:String):String {
|
||||
endfix = endPrefix;
|
||||
public static var suffix(default, set):String = "";
|
||||
private static function set_suffix(value:String):String {
|
||||
suffix = value;
|
||||
updateTitle();
|
||||
return endPrefix;
|
||||
return value;
|
||||
}
|
||||
|
||||
public static var preventClosing:Bool = true;
|
||||
@@ -43,10 +43,23 @@ class WindowUtils {
|
||||
|
||||
public static inline function resetTitle() {
|
||||
winTitle = Lib.application.meta["name"];
|
||||
prefix = endfix = "";
|
||||
resetAffixes();
|
||||
}
|
||||
|
||||
public static inline function resetAffixes() {
|
||||
prefix = suffix = "";
|
||||
updateTitle();
|
||||
}
|
||||
|
||||
public static inline function updateTitle()
|
||||
Lib.application.window.title = '$prefix$winTitle$endfix';
|
||||
Lib.application.window.title = '$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;
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ class CharacterEditor extends UIState {
|
||||
public override function create() {
|
||||
super.create();
|
||||
|
||||
WindowUtils.endfix = " (Character Editor)";
|
||||
WindowUtils.suffix = " (Character Editor)";
|
||||
SaveWarning.selectionClass = CharacterSelection;
|
||||
SaveWarning.saveFunc = () -> {_file_save(null);};
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ class Charter extends UIState {
|
||||
public override function create() {
|
||||
super.create();
|
||||
|
||||
WindowUtils.endfix = " (Chart Editor)";
|
||||
WindowUtils.suffix = " (Chart Editor)";
|
||||
SaveWarning.selectionClass = CharterSelection;
|
||||
SaveWarning.saveFunc = () -> {_file_save(null);};
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ class UIState extends MusicBeatState {
|
||||
super.destroy();
|
||||
__mousePos.put();
|
||||
|
||||
WindowUtils.resetTitle();
|
||||
WindowUtils.resetAffixes();
|
||||
SaveWarning.reset();
|
||||
|
||||
FlxG.stage.window.onKeyDown.remove(onKeyDown);
|
||||
|
||||
@@ -751,8 +751,8 @@ class PlayState extends MusicBeatState
|
||||
FlxG.sound.load(Paths.sound(s));
|
||||
|
||||
if (chartingMode) {
|
||||
WindowUtils.endfix = " (Chart Playtesting)";
|
||||
WindowUtils.prefix = Charter.undos.unsaved ? "* " : "";
|
||||
WindowUtils.suffix = " (Chart Playtesting)";
|
||||
|
||||
SaveWarning.showWarning = Charter.undos.unsaved;
|
||||
SaveWarning.selectionClass = CharterSelection;
|
||||
@@ -950,7 +950,7 @@ class PlayState extends MusicBeatState
|
||||
FlxG.sound.destroySound(vocals);
|
||||
}
|
||||
|
||||
WindowUtils.resetTitle();
|
||||
WindowUtils.resetAffixes();
|
||||
SaveWarning.reset();
|
||||
|
||||
instance = null;
|
||||
|
||||
Reference in New Issue
Block a user