Skip to content

Commit 1d94945

Browse files
committed
WindowUtil.resetAffixes + typo fix
1 parent a054381 commit 1d94945

5 files changed

Lines changed: 30 additions & 17 deletions

File tree

source/funkin/backend/utils/WindowUtils.hx

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ import openfl.Lib;
44

55
class WindowUtils {
66
public static var winTitle(default, set):String;
7-
public static function set_winTitle(newWinTitle:String):String {
8-
winTitle = newWinTitle;
7+
private static function set_winTitle(value:String):String {
8+
winTitle = value;
99
updateTitle();
10-
return newWinTitle;
10+
return value;
1111
}
1212
public static var prefix(default, set):String = "";
13-
public static function set_prefix(newPrefix:String):String {
14-
prefix = newPrefix;
13+
private static function set_prefix(value:String):String {
14+
prefix = value;
1515
updateTitle();
16-
return newPrefix;
16+
return value;
1717
}
18-
public static var endfix(default, set):String = "";
19-
public static function set_endfix(endPrefix:String):String {
20-
endfix = endPrefix;
18+
public static var suffix(default, set):String = "";
19+
private static function set_suffix(value:String):String {
20+
suffix = value;
2121
updateTitle();
22-
return endPrefix;
22+
return value;
2323
}
2424

2525
public static var preventClosing:Bool = true;
@@ -43,10 +43,23 @@ class WindowUtils {
4343

4444
public static inline function resetTitle() {
4545
winTitle = Lib.application.meta["name"];
46-
prefix = endfix = "";
46+
resetAffixes();
47+
}
48+
49+
public static inline function resetAffixes() {
50+
prefix = suffix = "";
4751
updateTitle();
4852
}
4953

5054
public static inline function updateTitle()
51-
Lib.application.window.title = '$prefix$winTitle$endfix';
55+
Lib.application.window.title = '$prefix$winTitle$suffix';
56+
57+
// backwards compat
58+
@:noCompletion public static var endfix(get, set):String;
59+
@:noCompletion private static function set_endfix(value:String):String {
60+
return suffix = value;
61+
}
62+
@:noCompletion private static function get_endfix():String {
63+
return suffix;
64+
}
5265
}

source/funkin/editors/character/CharacterEditor.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class CharacterEditor extends UIState {
4949
public override function create() {
5050
super.create();
5151

52-
WindowUtils.endfix = " (Character Editor)";
52+
WindowUtils.suffix = " (Character Editor)";
5353
SaveWarning.selectionClass = CharacterSelection;
5454
SaveWarning.saveFunc = () -> {_file_save(null);};
5555

source/funkin/editors/charter/Charter.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Charter extends UIState {
109109
public override function create() {
110110
super.create();
111111

112-
WindowUtils.endfix = " (Chart Editor)";
112+
WindowUtils.suffix = " (Chart Editor)";
113113
SaveWarning.selectionClass = CharterSelection;
114114
SaveWarning.saveFunc = () -> {_file_save(null);};
115115

source/funkin/editors/ui/UIState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class UIState extends MusicBeatState {
129129
super.destroy();
130130
__mousePos.put();
131131

132-
WindowUtils.resetTitle();
132+
WindowUtils.resetAffixes();
133133
SaveWarning.reset();
134134

135135
FlxG.stage.window.onKeyDown.remove(onKeyDown);

source/funkin/game/PlayState.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,8 @@ class PlayState extends MusicBeatState
751751
FlxG.sound.load(Paths.sound(s));
752752

753753
if (chartingMode) {
754-
WindowUtils.endfix = " (Chart Playtesting)";
755754
WindowUtils.prefix = Charter.undos.unsaved ? "* " : "";
755+
WindowUtils.suffix = " (Chart Playtesting)";
756756

757757
SaveWarning.showWarning = Charter.undos.unsaved;
758758
SaveWarning.selectionClass = CharterSelection;
@@ -950,7 +950,7 @@ class PlayState extends MusicBeatState
950950
FlxG.sound.destroySound(vocals);
951951
}
952952

953-
WindowUtils.resetTitle();
953+
WindowUtils.resetAffixes();
954954
SaveWarning.reset();
955955

956956
instance = null;

0 commit comments

Comments
 (0)