From 9c18a020c66831169e3a6c7443f20c0fd65e77d8 Mon Sep 17 00:00:00 2001 From: DeaTh-G Date: Thu, 20 Feb 2025 19:33:48 +0100 Subject: [PATCH] fix options menu descriptions --- .../gpu/imgui/imgui_font_builder.cpp | 52 +++++++++++++------ UnleashedRecomp/locale/config_locale.cpp | 4 +- UnleashedRecomp/ui/imgui_utils.cpp | 2 +- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp b/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp index 63a06be1..d5baf98e 100644 --- a/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp +++ b/UnleashedRecomp/gpu/imgui/imgui_font_builder.cpp @@ -220,6 +220,8 @@ static bool FontBuilder_Build(ImFontAtlas* atlas) for (size_t i = 0; i < atlas->ConfigData.size(); i++) { + double spaceAdvance = 0.0; + auto& config = atlas->ConfigData[i]; bool increaseSpacing = strstr(config.Name, "Seurat") != nullptr; @@ -232,8 +234,15 @@ static bool FontBuilder_Build(ImFontAtlas* atlas) glyph.getQuadAtlasBounds(u0, v0, u1, v1); double advance = glyph.getAdvance(); - if (increaseSpacing && glyph.getCodepoint() == ' ') - advance *= 1.5; + if (glyph.getCodepoint() == ' ') + { + if (increaseSpacing) + { + advance *= 1.5; + } + + spaceAdvance = advance; + } config.DstFont->AddGlyph( &config, @@ -247,21 +256,34 @@ static bool FontBuilder_Build(ImFontAtlas* atlas) u1 / packer.width, v0 / packer.height, advance); - - config.DstFont->AddGlyph( - &config, - 0x200B, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f, - 0.0f); } + config.DstFont->AddGlyph( + &config, + 0x200B, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f); + + config.DstFont->AddGlyph( + &config, + 0x2005, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + 0.0f, + spaceAdvance); + config.DstFont->BuildLookupTable(); } diff --git a/UnleashedRecomp/locale/config_locale.cpp b/UnleashedRecomp/locale/config_locale.cpp index eb953f8e..a02b10f7 100644 --- a/UnleashedRecomp/locale/config_locale.cpp +++ b/UnleashedRecomp/locale/config_locale.cpp @@ -418,7 +418,7 @@ CONFIG_DEFINE_LOCALE(MusicAttenuation) CONFIG_DEFINE_LOCALE(ChannelConfiguration) { { ELanguage::English, { "Channel Configuration", "Change the output mode for your audio device." } }, - { ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\n[ 出 力 :しゅつりょく]モード\u200Bを[変更:へんこう]できます" } }, + { ELanguage::Japanese, { "チャンネル[設定:せってい]", "オーディオデバイスの\u200B[\u2005出\u2005力\u2005:しゅつりょく]モード\u200Bを[変更:へんこう]できます" } }, { ELanguage::German, { "Kanalkonfiguration", "Ändere den Ausgabemodus für dein Audioausgabegerät." } }, { ELanguage::French, { "Configuration sortie audio", "Modifie le mode de sortie pour votre périphérique audio." } }, { ELanguage::Spanish, { "Configuración de canales", "Cambia el modo de salida para tu dispositivo de audio." } }, @@ -497,7 +497,7 @@ CONFIG_DEFINE_LOCALE(Subtitles) CONFIG_DEFINE_LOCALE(BattleTheme) { { ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat.\n\nExorcism missions and miniboss themes will be unaffected." } }, - { ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[ 除 霊 :エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } }, + { ELanguage::Japanese, { "バトルテーマ", "バトル[中:ちゅう]に\u200Bウェアホッグの\u200Bバトルテーマを\u200B[再生:さいせい]するか\u200B[選択:せんたく]できます\n\nこのオプションは\u200B[次回:じかい]のバトルに\u200B[適用:てきよう]されます\n\n[\u2005除\u2005霊\u2005:エクソシズム]ミッションと\u200Bミニボステーマは\u200B[影響:えいきょう]されません" } }, { ELanguage::German, { "Kampfmusik", "Spiele die Kampfmusik des Werehogs während dem Kämpfen ab.\n\nDiese Option tritt das nächste Mal, wenn du in einen Kampf gerätst, in Kraft.\n\nExorzismen und Mini-Bosse werden hiervon nicht beeinflusst." } }, { ELanguage::French, { "Thème de combat", "Joue le thème de combat du Werehog pendant les combat.\n\nCette option s'appliquera la prochaine fois que vous serez en combat.\n\nLes missions d'exorcisme et les thèmes des miniboss ne seront pas affectés." } }, { ELanguage::Spanish, { "Tema de batalla", "Reproduce el tema de batalla del Werehog durante el combate.\n\nEsta opción se aplicará la próxima vez que entres en combate.\n\nLas misiones de exorcismo y los temas de los minijefes no se verán afectados." } }, diff --git a/UnleashedRecomp/ui/imgui_utils.cpp b/UnleashedRecomp/ui/imgui_utils.cpp index be085b4c..fa89cc27 100644 --- a/UnleashedRecomp/ui/imgui_utils.cpp +++ b/UnleashedRecomp/ui/imgui_utils.cpp @@ -680,7 +680,7 @@ void DrawRubyAnnotatedText(const ImFont* font, float fontSize, float maxWidth, c for (auto& line : lines) { line = ReAddRubyAnnotations(line, input.second); - if (!line.empty() && line.substr(0, 3) != "「" && leadingSpace) + if (!line.empty() && line.substr(0, 3) != "「" && leadingSpace) { line.insert(0, " "); }