Skip to content

Commit b80c492

Browse files
committed
FIx customizable fontName
1 parent ca08536 commit b80c492

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

source/funkin/backend/system/framerate/CodenameBuildField.hx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import openfl.text.TextField;
66
class CodenameBuildField extends TextField {
77
public function new() {
88
super();
9-
defaultTextFormat = Framerate.textFormat;
109
autoSize = LEFT;
1110
multiline = wordWrap = false;
1211
reload();
1312
}
1413

1514
public function reload() {
16-
#if COMPILE_EXPERIMENTAL
15+
defaultTextFormat = Framerate.textFormat;
16+
17+
#if TEST_BUILD
18+
text = '${Flags.VERSION_MESSAGE} (Test Build)';
19+
#elseif COMPILE_EXPERIMENTAL
1720
text = '${Flags.VERSION_MESSAGE} (Experimental Build)';
1821
#else
1922
text = '${Flags.VERSION_MESSAGE}';

source/funkin/backend/system/framerate/Framerate.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class Framerate extends Sprite {
7676
}
7777

7878
public function reload() {
79+
textFormat = new TextFormat(fontName, 12, -1);
7980
for(c in categories)
8081
c.reload();
8182
#if SHOW_BUILD_ON_FPS

source/funkin/backend/system/framerate/FramerateCategory.hx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ class FramerateCategory extends Sprite {
4040
this.text.y = this.title.y + this.title.height + 2;
4141
}
4242

43-
public function reload() {}
43+
public function reload() {
44+
for(label in [this.title, this.text]) label.defaultTextFormat = new TextFormat(Framerate.fontName, label == this.title ? 18 : 12, -1);
45+
}
4446

4547
public override function __enterFrame(t:Float) {
4648
if (alpha <= 0.05) return;

source/funkin/backend/system/framerate/FramerateCounter.hx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class FramerateCounter extends Sprite {
3535
}
3636

3737
public function reload() {
38+
for (label in [fpsNum, fpsLabel]) label.defaultTextFormat = new TextFormat(Framerate.fontName, label == fpsNum ? 18 : 12, -1);
3839
lastUpdateTime = 0;
3940
}
4041

source/funkin/backend/system/framerate/MemoryCounter.hx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ class MemoryCounter extends Sprite {
2323
label.y = 0;
2424
label.text = "MEM";
2525
label.multiline = label.wordWrap = false;
26-
label.defaultTextFormat = new TextFormat(Framerate.fontName, 12, -1);
26+
label.defaultTextFormat = Framerate.textFormat;
2727
label.selectable = false;
2828
addChild(label);
2929
}
3030
memoryPeakText.alpha = 0.5;
3131
}
3232

33-
public function reload() {}
33+
public function reload() {
34+
for(label in [memoryText, memoryPeakText]) label.defaultTextFormat = Framerate.textFormat;
35+
}
3436

3537
public override function __enterFrame(t:Float) {
3638
if (alpha <= 0.05) return;

0 commit comments

Comments
 (0)