2022-07-13 21:23:56 -04:00
|
|
|
game:addlocalizedstring("MENU_english", "English")
|
|
|
|
game:addlocalizedstring("MENU_french", "Français")
|
|
|
|
game:addlocalizedstring("MENU_german", "Deutsch")
|
|
|
|
game:addlocalizedstring("MENU_italian", "Italiano")
|
|
|
|
game:addlocalizedstring("MENU_spanish", "Español")
|
2022-07-13 22:16:39 -04:00
|
|
|
game:addlocalizedstring("MENU_russian", "Русский")
|
|
|
|
game:addlocalizedstring("MENU_polish", "Polski")
|
2022-07-13 21:23:56 -04:00
|
|
|
game:addlocalizedstring("MENU_portuguese", "Português")
|
2022-07-14 07:42:38 -04:00
|
|
|
game:addlocalizedstring("MENU_japanese_full", "日本語")
|
|
|
|
game:addlocalizedstring("MENU_japanese_partial", "日本語(一部)")
|
|
|
|
game:addlocalizedstring("MENU_traditional_chinese", "繁體中文")
|
2022-07-13 21:23:56 -04:00
|
|
|
game:addlocalizedstring("MENU_simplified_chinese", "简体中文")
|
2022-07-14 08:11:06 -04:00
|
|
|
game:addlocalizedstring("MENU_arabic", "العربية")
|
2022-08-22 03:15:45 -04:00
|
|
|
game:addlocalizedstring("MENU_czech", "České")
|
|
|
|
game:addlocalizedstring("MENU_spanishna", "Español (América Latina)") -- text only (English dubbing)
|
2022-07-13 21:23:56 -04:00
|
|
|
game:addlocalizedstring("MENU_korean", "한국어")
|
|
|
|
game:addlocalizedstring("MENU_english_safe", "English (Safe)")
|
2022-08-22 03:15:45 -04:00
|
|
|
game:addlocalizedstring("MENU_russian_partial", "Русский (Англ. озвучка)") -- text only (English dubbing)
|
2022-07-13 21:23:56 -04:00
|
|
|
|
|
|
|
LUI.addmenubutton("pc_controls", {
|
|
|
|
index = 4,
|
|
|
|
text = "@LUA_MENU_CHOOSE_LANGUAGE",
|
|
|
|
description = Engine.Localize("@LUA_MENU_CHOOSE_LANGUAGE_DESC"),
|
|
|
|
callback = function()
|
|
|
|
LUI.FlowManager.RequestAddMenu(nil, "choose_language_menu")
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2022-08-22 03:15:45 -04:00
|
|
|
local universalfont = RegisterFont("fallback/fonts/default.otf", 30)
|
2022-07-13 21:23:56 -04:00
|
|
|
|
2022-08-22 03:15:45 -04:00
|
|
|
local function setuniversalfont(lang)
|
|
|
|
LUI.MenuGenericButtons.ButtonLabelFont.Font = universalfont
|
2022-07-15 17:07:01 -04:00
|
|
|
end
|
|
|
|
|
2022-07-13 21:23:56 -04:00
|
|
|
LUI.MenuBuilder.registerType("choose_language_menu", function(a1)
|
|
|
|
local menu = LUI.MenuTemplate.new(a1, {
|
|
|
|
menu_title = "@LUA_MENU_CHOOSE_LANGUAGE",
|
|
|
|
menu_list_divider_top_offset = -(LUI.H1MenuTab.tabChangeHoldingElementHeight + H1MenuDims.spacing),
|
2022-08-22 03:15:45 -04:00
|
|
|
menu_width = 240,
|
2022-07-13 21:23:56 -04:00
|
|
|
uppercase_title = true
|
|
|
|
})
|
|
|
|
|
|
|
|
local languages = Engine.GetSupportedLanguages()
|
2022-09-05 19:33:27 -04:00
|
|
|
local originalfont = LUI.MenuGenericButtons.ButtonLabelFont.Font
|
2022-07-13 21:23:56 -04:00
|
|
|
|
|
|
|
for i = 1, #languages do
|
|
|
|
local id = languages[i].id
|
|
|
|
|
2022-07-15 17:07:01 -04:00
|
|
|
local lang = Engine.GetCurrentLanguage()
|
|
|
|
|
2022-08-22 03:15:45 -04:00
|
|
|
setuniversalfont(id)
|
|
|
|
|
2022-07-13 21:23:56 -04:00
|
|
|
local button = menu:AddButton("", function()
|
|
|
|
LUI.FlowManager.RequestAddMenu(nil, "choose_language_confirm_popup", false, nil, true, {
|
|
|
|
language = languages[i].id
|
|
|
|
})
|
2022-08-22 03:15:45 -04:00
|
|
|
end, languages[i].id == Engine.GetCurrentLanguage(), true, nil, {
|
|
|
|
desc_text = Engine.Localize("LOCALE_" .. (languages[i].id))
|
|
|
|
})
|
2022-07-13 21:23:56 -04:00
|
|
|
|
|
|
|
local label = button:getFirstDescendentById("text_label")
|
|
|
|
label:setText(Engine.ToUpperCase(languages[i].name))
|
|
|
|
end
|
|
|
|
|
2022-09-05 19:33:27 -04:00
|
|
|
LUI.MenuGenericButtons.ButtonLabelFont.Font = originalfont
|
|
|
|
|
2022-07-13 21:23:56 -04:00
|
|
|
LUI.Options.InitScrollingList(menu.list, nil, {
|
2022-08-22 03:15:45 -04:00
|
|
|
rows = 10
|
2022-07-13 21:23:56 -04:00
|
|
|
})
|
2022-08-22 03:15:45 -04:00
|
|
|
|
|
|
|
LUI.Options.AddOptionTextInfo(menu)
|
2022-07-13 21:23:56 -04:00
|
|
|
menu:AddBackButton()
|
|
|
|
|
|
|
|
return menu
|
|
|
|
end)
|
2022-07-15 18:00:35 -04:00
|
|
|
|
2022-08-22 03:15:45 -04:00
|
|
|
-- global patch
|
|
|
|
LUI.UIButtonText.IsOffsetedLanguage = function()
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
-- pol/rus patch
|
2022-07-15 18:00:35 -04:00
|
|
|
|
|
|
|
if (not Engine.InFrontend()) then
|
|
|
|
local weaponinfodef = LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"]
|
|
|
|
LUI.MenuBuilder.m_definitions["WeaponInfoHudDef"] = function(...)
|
|
|
|
local rus = CoD.Language.Russian
|
|
|
|
CoD.Language.Russian = 1337
|
2022-08-22 03:15:45 -04:00
|
|
|
local pol = CoD.Language.Polish
|
|
|
|
CoD.Language.Polish = 1338
|
2022-07-15 18:00:35 -04:00
|
|
|
local res = weaponinfodef(...)
|
|
|
|
CoD.Language.Russian = rus
|
2022-08-22 03:15:45 -04:00
|
|
|
CoD.Language.Polish = pol
|
2022-07-15 18:00:35 -04:00
|
|
|
return res
|
|
|
|
end
|
|
|
|
else
|
|
|
|
local levelselectmenu = LUI.sp_menus.LevelSelectMenu
|
|
|
|
local setupinfobox = levelselectmenu.SetupInfoBoxLeftForArcadeMode
|
|
|
|
levelselectmenu.SetupInfoBoxLeftForArcadeMode = function(...)
|
|
|
|
local rus = CoD.Language.Russian
|
|
|
|
CoD.Language.Russian = 1337
|
2022-08-22 03:15:45 -04:00
|
|
|
local pol = CoD.Language.Polish
|
|
|
|
CoD.Language.Polish = 1338
|
2022-07-15 18:00:35 -04:00
|
|
|
local res = setupinfobox(...)
|
|
|
|
CoD.Language.Russian = rus
|
2022-08-22 03:15:45 -04:00
|
|
|
CoD.Language.Polish = pol
|
2022-07-15 18:00:35 -04:00
|
|
|
return res
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-08-22 03:15:45 -04:00
|
|
|
-- ara/ces/pol/rus patch
|
2022-07-15 18:00:35 -04:00
|
|
|
|
|
|
|
local lang = Engine.GetCurrentLanguage()
|
2022-08-22 03:15:45 -04:00
|
|
|
if (lang == 5 or lang == 6 or lang == 12 or lang == 13 or lang == 17) then
|
2022-07-15 18:00:35 -04:00
|
|
|
local scale = function (size)
|
|
|
|
return size * 720 / 1080
|
|
|
|
end
|
|
|
|
|
|
|
|
CoD.TextSettings.SP_HudAmmoStatusText = {
|
|
|
|
Font = RegisterFont("fonts/bank.ttf", 16),
|
|
|
|
Height = 16
|
|
|
|
}
|
|
|
|
|
|
|
|
CoD.TextSettings.SP_HudAmmoCounterFont = {
|
|
|
|
Font = RegisterFont("fonts/bank.ttf", 34),
|
|
|
|
Height = 34
|
|
|
|
}
|
|
|
|
|
|
|
|
CoD.TextSettings.HudAmmoCounterFont = {
|
|
|
|
Font = RegisterFont("fonts/bank.ttf", 105),
|
|
|
|
Height = 64
|
|
|
|
}
|
|
|
|
|
|
|
|
CoD.TextSettings.H2TitleFont = {
|
|
|
|
Font = RegisterFont("fonts/bank.ttf", 56),
|
|
|
|
Height = scale(56)
|
|
|
|
}
|
2022-09-05 19:33:27 -04:00
|
|
|
end
|