From fe9e7889f80dc7d3fd97814986eb9c58a5e0467d Mon Sep 17 00:00:00 2001 From: fed <58637860+fedddddd@users.noreply.github.com> Date: Fri, 24 Feb 2023 20:14:44 +0100 Subject: [PATCH] Use language.iscustom --- data/cdata/ui_scripts/settings/language.lua | 2 +- src/client/component/language.cpp | 5 +++++ src/client/component/language.hpp | 1 + src/client/component/ui_scripting.cpp | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/data/cdata/ui_scripts/settings/language.lua b/data/cdata/ui_scripts/settings/language.lua index 732eaff8..794c6a6b 100644 --- a/data/cdata/ui_scripts/settings/language.lua +++ b/data/cdata/ui_scripts/settings/language.lua @@ -83,7 +83,7 @@ LUI.MenuBuilder.registerType("choose_language_menu", function(a1) LUI.Options.AddOptionTextInfo(menu) - if language.isnonlatin() and config.get("language") ~= "czech" then + if (language.isnonlatin() and not language.iscustom()) then if (config.get("disable_custom_fonts")) then menu:AddHelp({ name = "add_button_helper_text", diff --git a/src/client/component/language.cpp b/src/client/component/language.cpp index 1ddeb05c..576525b1 100644 --- a/src/client/component/language.cpp +++ b/src/client/component/language.cpp @@ -125,6 +125,11 @@ namespace language return asian_languages.contains(current()); } + bool is_custom() + { + return custom_languages.contains(current()); + } + void set(const std::string& lang) { config::set("language", lang); diff --git a/src/client/component/language.hpp b/src/client/component/language.hpp index 0a2f21c0..5cc74dac 100644 --- a/src/client/component/language.hpp +++ b/src/client/component/language.hpp @@ -16,4 +16,5 @@ namespace language bool is_slavic(); bool is_arabic(); bool is_asian(); + bool is_custom(); } diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index 052f3689..e09116b1 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -239,6 +239,7 @@ namespace ui_scripting language_table["isslavic"] = language::is_slavic; language_table["isarabic"] = language::is_arabic; language_table["isasian"] = language::is_asian; + language_table["iscustom"] = language::is_custom; lua["language"] = language_table;