From a30b399d987f130dcf7be40457c7ce9e5b3c7d99 Mon Sep 17 00:00:00 2001 From: Joalor64 Date: Wed, 27 Nov 2024 09:26:25 -0500 Subject: [PATCH] maybe fix? --- source/backend/Localization.hx | 8 +++++--- source/backend/Paths.hx | 2 +- source/options/LanguageState.hx | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/backend/Localization.hx b/source/backend/Localization.hx index dedda4e..d0fb45b 100644 --- a/source/backend/Localization.hx +++ b/source/backend/Localization.hx @@ -90,14 +90,16 @@ class Localization { return path; } - public static function loadCustomFont(language:String):String { - var path:String = Paths.file('languages/fonts/' + language + '.ttf'); + private static function loadCustomFont(language:String):String { + var target:String = language != null ? language : currentLanguage; + var path:String = Paths.file('languages/fonts/' + target + '.ttf'); if (Paths.exists(path)) { trace('custom font loaded for $language: $path'); return customFontPath = path; } - return null; + trace('no custom font for $language'); + return Paths.font('vcr'); } public static function getCustomFont():String { diff --git a/source/backend/Paths.hx b/source/backend/Paths.hx index 11b838a..be58ac4 100644 --- a/source/backend/Paths.hx +++ b/source/backend/Paths.hx @@ -166,7 +166,7 @@ class Paths { return file('songs/$key/chart.json'); inline static public function font(key:String) { - var path:String = file('fonts/$key'); + var path:String = file('fonts/$key'); if (path.extension() == '') { if (exists(path.withExtension("ttf"))) diff --git a/source/options/LanguageState.hx b/source/options/LanguageState.hx index fe1909e..6922dc0 100644 --- a/source/options/LanguageState.hx +++ b/source/options/LanguageState.hx @@ -6,6 +6,7 @@ class LanguageState extends ExtendableState { var langStrings:Array = []; var group:FlxTypedGroup; var curSelected:Int = 0; + var camFollow:FlxObject; override function create() { @@ -80,7 +81,6 @@ class LanguageState extends ExtendableState { if (Input.justPressed('accept')) { SaveData.settings.lang = langStrings[curSelected].code; Localization.switchLanguage(SaveData.settings.lang); - Localization.loadCustomFont(SaveData.settings.lang); SaveData.saveSettings(); ExtendableState.switchState(new OptionsState()); FlxG.sound.play(Paths.sound("select"));