From b80c492afba78a6566265745dbe5c4cfeafcf65f Mon Sep 17 00:00:00 2001 From: Ralty <78720179+Raltyro@users.noreply.github.com> Date: Wed, 1 Apr 2026 19:33:15 +0700 Subject: [PATCH] FIx customizable fontName --- .../funkin/backend/system/framerate/CodenameBuildField.hx | 7 +++++-- source/funkin/backend/system/framerate/Framerate.hx | 1 + .../funkin/backend/system/framerate/FramerateCategory.hx | 4 +++- source/funkin/backend/system/framerate/FramerateCounter.hx | 1 + source/funkin/backend/system/framerate/MemoryCounter.hx | 6 ++++-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/source/funkin/backend/system/framerate/CodenameBuildField.hx b/source/funkin/backend/system/framerate/CodenameBuildField.hx index 656c0fff..57bf752a 100644 --- a/source/funkin/backend/system/framerate/CodenameBuildField.hx +++ b/source/funkin/backend/system/framerate/CodenameBuildField.hx @@ -6,14 +6,17 @@ import openfl.text.TextField; class CodenameBuildField extends TextField { public function new() { super(); - defaultTextFormat = Framerate.textFormat; autoSize = LEFT; multiline = wordWrap = false; reload(); } public function reload() { - #if COMPILE_EXPERIMENTAL + defaultTextFormat = Framerate.textFormat; + + #if TEST_BUILD + text = '${Flags.VERSION_MESSAGE} (Test Build)'; + #elseif COMPILE_EXPERIMENTAL text = '${Flags.VERSION_MESSAGE} (Experimental Build)'; #else text = '${Flags.VERSION_MESSAGE}'; diff --git a/source/funkin/backend/system/framerate/Framerate.hx b/source/funkin/backend/system/framerate/Framerate.hx index b1ac78af..0d04c14b 100644 --- a/source/funkin/backend/system/framerate/Framerate.hx +++ b/source/funkin/backend/system/framerate/Framerate.hx @@ -76,6 +76,7 @@ class Framerate extends Sprite { } public function reload() { + textFormat = new TextFormat(fontName, 12, -1); for(c in categories) c.reload(); #if SHOW_BUILD_ON_FPS diff --git a/source/funkin/backend/system/framerate/FramerateCategory.hx b/source/funkin/backend/system/framerate/FramerateCategory.hx index 434de06e..2749d920 100644 --- a/source/funkin/backend/system/framerate/FramerateCategory.hx +++ b/source/funkin/backend/system/framerate/FramerateCategory.hx @@ -40,7 +40,9 @@ class FramerateCategory extends Sprite { this.text.y = this.title.y + this.title.height + 2; } - public function reload() {} + public function reload() { + for(label in [this.title, this.text]) label.defaultTextFormat = new TextFormat(Framerate.fontName, label == this.title ? 18 : 12, -1); + } public override function __enterFrame(t:Float) { if (alpha <= 0.05) return; diff --git a/source/funkin/backend/system/framerate/FramerateCounter.hx b/source/funkin/backend/system/framerate/FramerateCounter.hx index ead2fbd5..3a00a3ec 100644 --- a/source/funkin/backend/system/framerate/FramerateCounter.hx +++ b/source/funkin/backend/system/framerate/FramerateCounter.hx @@ -35,6 +35,7 @@ class FramerateCounter extends Sprite { } public function reload() { + for (label in [fpsNum, fpsLabel]) label.defaultTextFormat = new TextFormat(Framerate.fontName, label == fpsNum ? 18 : 12, -1); lastUpdateTime = 0; } diff --git a/source/funkin/backend/system/framerate/MemoryCounter.hx b/source/funkin/backend/system/framerate/MemoryCounter.hx index 5c68ac69..f95a2a93 100644 --- a/source/funkin/backend/system/framerate/MemoryCounter.hx +++ b/source/funkin/backend/system/framerate/MemoryCounter.hx @@ -23,14 +23,16 @@ class MemoryCounter extends Sprite { label.y = 0; label.text = "MEM"; label.multiline = label.wordWrap = false; - label.defaultTextFormat = new TextFormat(Framerate.fontName, 12, -1); + label.defaultTextFormat = Framerate.textFormat; label.selectable = false; addChild(label); } memoryPeakText.alpha = 0.5; } - public function reload() {} + public function reload() { + for(label in [memoryText, memoryPeakText]) label.defaultTextFormat = Framerate.textFormat; + } public override function __enterFrame(t:Float) { if (alpha <= 0.05) return;