From 5c622d993a9e51af94c1164fc7adc3b2a565f7a1 Mon Sep 17 00:00:00 2001 From: Vlad Loktionov Date: Fri, 24 Feb 2023 15:14:22 +0300 Subject: [PATCH] Fixes for CJK * Fix ammo counter for CJK * Add Korean to CJK list * Minor additions for Czech --- data/cdata/ui_scripts/settings/language.lua | 24 ++++++++++--------- .../h2_mod_pre_gfx/font_replacements.csv | 2 ++ data/zonetool/localizedstrings/czech.json | 7 +++--- src/client/component/filesystem.cpp | 4 ++-- src/client/component/language.cpp | 7 +++--- src/client/component/language.hpp | 2 +- src/client/component/ui_scripting.cpp | 2 +- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/data/cdata/ui_scripts/settings/language.lua b/data/cdata/ui_scripts/settings/language.lua index b5af4f43..732eaff8 100644 --- a/data/cdata/ui_scripts/settings/language.lua +++ b/data/cdata/ui_scripts/settings/language.lua @@ -59,7 +59,7 @@ LUI.MenuBuilder.registerType("choose_language_menu", function(a1) local lang = Engine.GetCurrentLanguage() - if language.isasian or not language.isnonlatin() or not config.get("disable_custom_fonts") then + if language.isasian() or not language.isnonlatin() or not config.get("disable_custom_fonts") then setuniversalfont(id) end @@ -108,7 +108,7 @@ LUI.MenuBuilder.registerType("choose_language_menu", function(a1) return menu end) --- rup patch +-- fix for Y-offset in button text (russian_partial, default font) if config.get("language") == "russian_partial" and config.get("disable_custom_fonts") then LUI.UIButtonText.IsOffsetedLanguage = function() return true @@ -116,12 +116,12 @@ if config.get("language") == "russian_partial" and config.get("disable_custom_fo end if not (config.get("disable_custom_fonts")) then - -- global patch + -- fix for Y-offset in button text (global patch, custom font) LUI.UIButtonText.IsOffsetedLanguage = function() return false end - -- pol/rus patch + -- fix for ammo counter (polish/russian) if not Engine.InFrontend() then local weaponinfodef = LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"] LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"] = function(...) @@ -149,8 +149,8 @@ if not (config.get("disable_custom_fonts")) then end end - -- ara/pol/rus patch - if language.ispolrus() or language.isarabic() then + -- fix for ammo counter (global patch) + if language.isnonlatin() then local scale = function(size) return size * 720 / 1080 end @@ -169,10 +169,12 @@ if not (config.get("disable_custom_fonts")) then Font = RegisterFont("fonts/mix_gothic.ttf", 105), Height = 64 } - - CoD.TextSettings.H2TitleFont = { - Font = RegisterFont("fonts/mix_gothic.ttf", 56), - Height = scale(56) - } + -- forced gothic font for headers (arabic/slavic) + if language.isslavic() or language.isarabic() then + CoD.TextSettings.H2TitleFont = { + Font = RegisterFont("fonts/mix_gothic.ttf", 56), + Height = scale(56) + } + end end end diff --git a/data/zonetool/h2_mod_pre_gfx/font_replacements.csv b/data/zonetool/h2_mod_pre_gfx/font_replacements.csv index 74fe68d4..518f3e67 100644 --- a/data/zonetool/h2_mod_pre_gfx/font_replacements.csv +++ b/data/zonetool/h2_mod_pre_gfx/font_replacements.csv @@ -8,6 +8,8 @@ japanese_full,fonts/default.otf,fonts/mix.ttf, japanese_full,fonts/defaultBold.otf,fonts/mix_open.ttf, japanese_partial,fonts/default.otf,fonts/mix.ttf, japanese_partial,fonts/defaultBold.otf,fonts/mix_open.ttf, +korean,fonts/default.otf,fonts/mix.ttf, +korean,fonts/defaultBold.otf,fonts/mix_open.ttf, polish,fonts/bank.ttf,fonts/mix_gothic.ttf, polish,fonts/default.otf,fonts/mix.ttf, polish,fonts/defaultBold.otf,fonts/mix_open.ttf, diff --git a/data/zonetool/localizedstrings/czech.json b/data/zonetool/localizedstrings/czech.json index 12329821..df42afaf 100644 --- a/data/zonetool/localizedstrings/czech.json +++ b/data/zonetool/localizedstrings/czech.json @@ -7,8 +7,8 @@ "LOCALE_5": "Ruština", "LOCALE_6": "Polština", "LOCALE_7": "Portugalština", - "LOCALE_8": "Japonština (částečně)", - "LOCALE_9": "Japonština", + "LOCALE_8": "Japonština", + "LOCALE_9": "Japonština (částečně)", "LOCALE_10": "Čínština (složité)", "LOCALE_11": "Čínština (zjednodušené)", "LOCALE_12": "Arabština", @@ -4103,6 +4103,7 @@ "MENU_YOU_MUST_SPECIFY_A_FILENAME": "Musíš zadat název souboru!", "MENU_ARE_YOU_SURE_QUIT": "Opravdu chceš odejít?", "MENU_QUIT_WARNING": "Opravdu chceš odejít?", + "MENU_SAVEQUIT_TEXT": "Opravdu chceš odejít? Ztratíš veškerý postup dosažený od posledního checkpointu.", "MENU_CONTROLS": "Ovladání", "MENU_CONTROLS_CAPS": "KLÁVESY", "MENU_LOOK": "Pohled", @@ -5304,7 +5305,7 @@ "MENU_SP_CONTINUE_TO_SPECIAL_OPS": "Pokračovat do zvláštních operací", "MENU_SP_CONTINUE_TO_SPECIAL_OPS_CAPS": "POKRAČOVAT DO ZVLÁŠTNÍCH OPERACÍ", "MENU_SP_CONTINUE_TO_MULTIPLAYER": "Pokračovat do Multiplayeru", - "MENU_SP_FOR_THE_RECORD": "„Udělej v tom pořádek“", + "MENU_SP_FOR_THE_RECORD": "„Tohle jen pro pořádek“", "MENU_SP_CHOOSE_A_DIFFERENT_OP": "Vybrat jinou operaci", "MENU_SP_NO_STARS_FOR_LOCKED_OP": "Nezískáš žádné hvězdy dokud si neodemkneš tuto operaci.", "MENU_SP_NOT_SIGNED_IN": "Nejsi přihlášen", diff --git a/src/client/component/filesystem.cpp b/src/client/component/filesystem.cpp index b911dcb8..d736ba59 100644 --- a/src/client/component/filesystem.cpp +++ b/src/client/component/filesystem.cpp @@ -60,9 +60,9 @@ namespace filesystem paths.push_back(path / "fallback"); } - if (language::is_polrus() || language::is_arabic()) + if (language::is_slavic() || language::is_arabic()) { - paths.push_back(path / "polrus"); + paths.push_back(path / "slavic"); } paths.push_back(path / code); diff --git a/src/client/component/language.cpp b/src/client/component/language.cpp index 72760ba7..1ddeb05c 100644 --- a/src/client/component/language.cpp +++ b/src/client/component/language.cpp @@ -30,7 +30,7 @@ namespace language {game::LANGUAGE_RUSSIAN_PARTIAL}, }; - std::unordered_set polish_russian_languages = + std::unordered_set slavic_languages = { {game::LANGUAGE_RUSSIAN}, {game::LANGUAGE_POLISH}, @@ -44,6 +44,7 @@ namespace language {game::LANGUAGE_JAPANESE_PARTIAL}, {game::LANGUAGE_TRADITIONAL_CHINESE}, {game::LANGUAGE_SIMPLIFIED_CHINESE}, + {game::LANGUAGE_KOREAN}, }; std::unordered_set custom_languages = @@ -109,9 +110,9 @@ namespace language return non_latin_languages.contains(current()); } - bool is_polrus() + bool is_slavic() { - return polish_russian_languages.contains(current()); + return slavic_languages.contains(current()); } bool is_arabic() diff --git a/src/client/component/language.hpp b/src/client/component/language.hpp index a549951a..0a2f21c0 100644 --- a/src/client/component/language.hpp +++ b/src/client/component/language.hpp @@ -13,7 +13,7 @@ namespace language game::language_t current(); bool is_non_latin(); - bool is_polrus(); + bool is_slavic(); bool is_arabic(); bool is_asian(); } diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index 0d61b1c9..052f3689 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -236,7 +236,7 @@ namespace ui_scripting auto language_table = table(); language_table["isnonlatin"] = language::is_non_latin; - language_table["ispolrus"] = language::is_polrus; + language_table["isslavic"] = language::is_slavic; language_table["isarabic"] = language::is_arabic; language_table["isasian"] = language::is_asian;