Minor fix (#422)

* Re-enable disable_useless_things.lua

* Minor localization changes (sync with H2)

* Update language.lua & stats/init.lua

* Fix for HUD ammo zeros
* Language: Reorganizing items on menu
* Stats: Fix localized headers
This commit is contained in:
Vlad 2022-12-22 17:51:33 +03:00 committed by GitHub
parent 09bba63918
commit 917dd80625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 52 additions and 40 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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?"
}

View File

@ -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?"
}

View File

@ -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."
}

View File

@ -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": "Запуск установленных модов.",

View File

@ -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: СЕТЕВАЯ ИГРА",