diff --git a/data/cdata/ui_scripts/patches/__init__.lua b/data/cdata/ui_scripts/patches/__init__.lua index c96b222d..6e0cc090 100644 --- a/data/cdata/ui_scripts/patches/__init__.lua +++ b/data/cdata/ui_scripts/patches/__init__.lua @@ -1,16 +1,17 @@ require("language") require("background_effects") -if (game:issingleplayer()) then +if game:issingleplayer() then require("sp_unlockall") return end -if (Engine.InFrontend()) then +require("disable_useless_things") + +if Engine.InFrontend() then require("shader_dialog") require("gamemodes") require("no_mode_switch") - require("disable_useless_things") else require("scoreboard") end diff --git a/data/cdata/ui_scripts/patches/disable_useless_things.lua b/data/cdata/ui_scripts/patches/disable_useless_things.lua index 59696748..69fa968a 100644 --- a/data/cdata/ui_scripts/patches/disable_useless_things.lua +++ b/data/cdata/ui_scripts/patches/disable_useless_things.lua @@ -1,12 +1,14 @@ --- Disable CP -Engine.SetDvarInt("ui_enable_cp", 0) +if Engine.InFrontend() then + -- Disable CP + Engine.SetDvarInt("ui_enable_cp", 0) --- Disable CP store -Engine.SetDvarInt("ui_show_store", 0) + -- Disable CP store + Engine.SetDvarInt("ui_show_store", 0) --- Remove CoD account button -if Engine.IsMultiplayer() and CoD.IsCoDAccountRegistrationAvailableInMyRegion() then - LUI.removemenubutton("pc_controls", 4) + -- Remove CoD account button + if Engine.IsMultiplayer() and CoD.IsCoDAccountRegistrationAvailableInMyRegion() then + LUI.removemenubutton("pc_controls", 4) + end end -- Remove social button diff --git a/data/cdata/ui_scripts/patches/language.lua b/data/cdata/ui_scripts/patches/language.lua index e9f2219e..2a62d98d 100644 --- a/data/cdata/ui_scripts/patches/language.lua +++ b/data/cdata/ui_scripts/patches/language.lua @@ -30,8 +30,8 @@ end LUI.addmenubutton("pc_controls", { index = 4, - text = "@MENU_LANGUAGE", - description = Engine.Localize("@LUA_MENU_CHOOSE_LANGUAGE"), + text = "LUA_MENU_CHOOSE_LANGUAGE", + description = Engine.Localize("LUA_MENU_CHOOSE_LANGUAGE_DESC"), callback = function() LUI.FlowManager.RequestAddMenu(nil, "choose_language_menu") end @@ -39,33 +39,11 @@ LUI.addmenubutton("pc_controls", { LUI.MenuBuilder.registerType("choose_language_menu", function(a1) local menu = LUI.MenuTemplate.new(a1, { - menu_title = "@LUA_MENU_CHOOSE_LANGUAGE", + menu_title = "LUA_MENU_CHOOSE_LANGUAGE", menu_list_divider_top_offset = -(LUI.H1MenuTab.tabChangeHoldingElementHeight + H1MenuDims.spacing), uppercase_title = true }) - function createdivider(menu, text) - local element = LUI.UIElement.new({ - leftAnchor = true, - rightAnchor = false, - left = 10, - right = 0, - topAnchor = true, - bottomAnchor = false, - top = 0, - bottom = 33.33 - }) - - element.scrollingToNext = true - element:addElement(LUI.MenuBuilder.BuildRegisteredType("h1_option_menu_titlebar", { - title_bar_text = text - })) - - menu.list:addElement(element) - end - - createdivider(menu, "^2" .. Engine.Localize("@LUA_MENU_DOWNLOAD") .. ": ^7https://docs.h1.gg/languages") - for i = 1, #available_languages do if does_zone_folder_exists(available_languages[i]) then menu:AddButton(Engine.Localize(string.format("MENU_%s", available_languages[i])), function() @@ -95,7 +73,33 @@ LUI.MenuBuilder.registerType("choose_language_menu", function(a1) }) LUI.Options.AddOptionTextInfo(menu) + + menu:AddHelp({ + name = "add_button_helper_text", + button_ref = "", + helper_text = "^2" .. Engine.Localize("@LUA_MENU_DOWNLOAD") .. ": ^7https://docs.h1.gg/languages", + side = "left", + priority = -9001, + clickable = false + }) + menu:AddBackButton() return menu end) + +-- fix for ammo zeros +if not Engine.InFrontend() then + local weaponinfodef = LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"] + LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"] = function(...) + Engine.GetCurrentLanguage = function() + return 0 + end + local res = weaponinfodef(...) + Engine.GetCurrentLanguage = function() + lang = Engine.GetDvarString("loc_language") + return lang + end + return res + end +end diff --git a/data/cdata/ui_scripts/stats/__init__.lua b/data/cdata/ui_scripts/stats/__init__.lua index 12db3f02..224bad3e 100644 --- a/data/cdata/ui_scripts/stats/__init__.lua +++ b/data/cdata/ui_scripts/stats/__init__.lua @@ -36,7 +36,7 @@ LUI.MenuBuilder.registerType("stats_menu", function(a1) menu_width = luiglobals.GenericMenuDims.OptionMenuWidth }) - createdivider(menu, "@LUA_MENU_SETTINGS") + createdivider(menu, "LUA_MENU_SETTINGS") LUI.Options.CreateOptionButton(menu, "cg_unlockall_items", "@LUA_MENU_UNLOCKALL_ITEMS", "@LUA_MENU_UNLOCKALL_ITEMS_DESC", {{ @@ -65,7 +65,7 @@ LUI.MenuBuilder.registerType("stats_menu", function(a1) value = false }}, nil, nil) - createdivider(menu, "@LUA_MENU_EDIT_STATS") + createdivider(menu, "LUA_MENU_EDIT_STATS") local prestige = Engine.GetPlayerData(0, CoD.StatsGroup.Ranked, "prestige") or 0 local experience = Engine.GetPlayerData(0, CoD.StatsGroup.Ranked, "experience") or 0 diff --git a/data/zonetool/localizedstrings/english.json b/data/zonetool/localizedstrings/english.json index 43c4aca0..f0b9b8dc 100644 --- a/data/zonetool/localizedstrings/english.json +++ b/data/zonetool/localizedstrings/english.json @@ -1,6 +1,6 @@ { "LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Unlock All Missions and Intel", "LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancel Unlock All Missions", - "LUA_MENU_CHOOSE_LANGUAGE": "Choose your language", + "LUA_MENU_CHOOSE_LANGUAGE_DESC": "Choose your language.", "MENU_APPLY_LANGUAGE_SETTINGS": "Apply language settings?" } \ No newline at end of file diff --git a/data/zonetool/localizedstrings/english_safe.json b/data/zonetool/localizedstrings/english_safe.json index 43c4aca0..f0b9b8dc 100644 --- a/data/zonetool/localizedstrings/english_safe.json +++ b/data/zonetool/localizedstrings/english_safe.json @@ -1,6 +1,6 @@ { "LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Unlock All Missions and Intel", "LUA_MENU_CANCEL_UNLOCK_CAPS": "Cancel Unlock All Missions", - "LUA_MENU_CHOOSE_LANGUAGE": "Choose your language", + "LUA_MENU_CHOOSE_LANGUAGE_DESC": "Choose your language.", "MENU_APPLY_LANGUAGE_SETTINGS": "Apply language settings?" } \ No newline at end of file diff --git a/data/zonetool/localizedstrings/french.json b/data/zonetool/localizedstrings/french.json index e1411ae1..f32229e3 100644 --- a/data/zonetool/localizedstrings/french.json +++ b/data/zonetool/localizedstrings/french.json @@ -46,5 +46,6 @@ "LOCALE_SPANISH": "Espagnol", "LOCALE_TRADITIONAL_CHINESE": "Chinois traditionnel", - "LUA_MENU_CHOOSE_LANGUAGE": "Choisissez la langue" + "LUA_MENU_CHOOSE_LANGUAGE": "Choisissez la langue", + "LUA_MENU_CHOOSE_LANGUAGE_DESC": "Choisissez la langue." } \ No newline at end of file diff --git a/data/zonetool/localizedstrings/russian.json b/data/zonetool/localizedstrings/russian.json index 3ed43a3c..5ac4fe31 100644 --- a/data/zonetool/localizedstrings/russian.json +++ b/data/zonetool/localizedstrings/russian.json @@ -8,6 +8,8 @@ "LUA_MENU_CAMPAIGN_UNLOCKED_ALL_TITLE": "Открыть все задания и чит-коды", "LUA_MENU_CANCEL_UNLOCK_CAPS": "Вернуться к своему прогрессу прохождения", + "LUA_MENU_CHOOSE_LANGUAGE": "Выбор языка", + "LUA_MENU_CHOOSE_LANGUAGE_DESC": "Поменять язык интерфейса и озвучки.", "MENU_MODS": "МОДЫ", "MENU_MODS_DESC": "Запуск установленных модов.", diff --git a/data/zonetool/rus_h1_mod_common_mp/localizedstrings/russian.json b/data/zonetool/rus_h1_mod_common_mp/localizedstrings/russian.json index 42a3d9de..b553977d 100644 --- a/data/zonetool/rus_h1_mod_common_mp/localizedstrings/russian.json +++ b/data/zonetool/rus_h1_mod_common_mp/localizedstrings/russian.json @@ -30,6 +30,8 @@ "LUA_MENU_SETTINGS": "Параметры", "LUA_MENU_EDIT_STATS": "Корректировка статистики", + "LUA_MENU_3RD_PARTY_CONTENT_DESC": "Согласны загрузить сторонний контент, необходимый для игры на этом сервере? (&&1)", + "LUA_MENU_MULTIPLAYER_CAPS": "H1-MOD: СЕТЕВАЯ ИГРА\n", "MENU_MULTIPLAYER_CAPS": "H1-MOD: СЕТЕВАЯ ИГРА",