Move data files
This commit is contained in:
BIN
data/cdata/fonts/arabic.ttf
Normal file
BIN
data/cdata/fonts/arabic.ttf
Normal file
Binary file not shown.
BIN
data/cdata/fonts/chinese.ttf
Normal file
BIN
data/cdata/fonts/chinese.ttf
Normal file
Binary file not shown.
BIN
data/cdata/fonts/japanese.ttf
Normal file
BIN
data/cdata/fonts/japanese.ttf
Normal file
Binary file not shown.
BIN
data/cdata/fonts/korean.ttf
Normal file
BIN
data/cdata/fonts/korean.ttf
Normal file
Binary file not shown.
3
data/cdata/localizedstrings/_arabic.json
Normal file
3
data/cdata/localizedstrings/_arabic.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_czech.json
Normal file
3
data/cdata/localizedstrings/_czech.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_french.json
Normal file
3
data/cdata/localizedstrings/_french.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_german.json
Normal file
3
data/cdata/localizedstrings/_german.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_japanese_full.json
Normal file
3
data/cdata/localizedstrings/_japanese_full.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_japenese_partial.json
Normal file
3
data/cdata/localizedstrings/_japenese_partial.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_korean.json
Normal file
3
data/cdata/localizedstrings/_korean.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_polish.json
Normal file
3
data/cdata/localizedstrings/_polish.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_portuguese.json
Normal file
3
data/cdata/localizedstrings/_portuguese.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_russian.json
Normal file
3
data/cdata/localizedstrings/_russian.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_russian_partial.json
Normal file
3
data/cdata/localizedstrings/_russian_partial.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_simplified_chinese.json
Normal file
3
data/cdata/localizedstrings/_simplified_chinese.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_spanish.json
Normal file
3
data/cdata/localizedstrings/_spanish.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_spanishna.json
Normal file
3
data/cdata/localizedstrings/_spanishna.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
3
data/cdata/localizedstrings/_traditional_chinese.json
Normal file
3
data/cdata/localizedstrings/_traditional_chinese.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"PLACEHOLDER": "PLACEHOLDER"
|
||||
}
|
38
data/cdata/localizedstrings/english.json
Normal file
38
data/cdata/localizedstrings/english.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"MENU_MODS_DESC": "Load installed mods.",
|
||||
"LUA_MENU_MOD_DESC_DEFAULT": "Load &&1.",
|
||||
"LUA_MENU_MOD_DESC": "&&1\nAuthor: &&2\nVersion: &&3",
|
||||
"LUA_MENU_LOADED_MOD": "Loaded mod: ^3&&1",
|
||||
"LUA_MENU_AVAILABLE_MODS": "Available mods",
|
||||
"LUA_MENU_UNLOAD": "Unload",
|
||||
"LUA_MENU_UNLOAD_DESC": "Unload the currently loaded mod.",
|
||||
"LUA_MENU_WORKSHOP": "Workshop",
|
||||
"LUA_MENU_WORKSHOP_DESC": "Download and install mods.",
|
||||
|
||||
"MENU_GENERAL": "H2-MOD",
|
||||
"MENU_GENERAL_DESC": "Set h2-mod's settings.",
|
||||
"LUA_MENU_AUTO_UPDATE": "Automatic updates",
|
||||
"LUA_MENU_AUTO_UPDATE_DESC": "Enable or disable automatic updates on startup.",
|
||||
"LUA_MENU_CHECK_UPDATES": "Check for updates",
|
||||
"LUA_MENU_CHECK_UPDATES_DESC": "Check for updates.",
|
||||
"LUA_MENU_DRAWING": "Hud",
|
||||
"LUA_MENU_UPDATES": "Updates",
|
||||
"LUA_MENU_RENDERING": "Rendering",
|
||||
"LUA_MENU_DRAW_FPS": "Draw FPS",
|
||||
"LUA_MENU_DRAW_FPS_DESC": "Enable or disable drawing fps or viewpos on screen.",
|
||||
"LUA_MENU_FPS_ONLY": "FPS only",
|
||||
"LUA_MENU_FPS_AND_VIEWPOS": "FPS and View Pos",
|
||||
"LUA_MENU_DRAW_SPEED": "Draw speed",
|
||||
"LUA_MENU_DRAW_SPEED_DESC": "Enable or disable drawing the player speed on screen.",
|
||||
"LUA_MENU_DRAW_SPEEDGRAPH": "Draw speed graph",
|
||||
"LUA_MENU_DRAW_SPEEDGRAPH_DESC": "Enable or disable the speed graph.",
|
||||
"LUA_MENU_R_FULLBRIGHT": "Fullbright",
|
||||
"LUA_MENU_R_FULLBRIGHT_DESC": "Change the fullbright mode",
|
||||
"LUA_MENU_MODE2": "No dynamic lighting",
|
||||
"LUA_MENU_MODE3": "Debug shader",
|
||||
|
||||
"MENU_SYSINFO_CUSTOMER_SUPPORT_LINK": "Github Page:",
|
||||
"MENU_SYSINFO_CUSTOMER_SUPPORT_URL": "https://github.com/fedddddd/h2-mod",
|
||||
"MENU_SYSINFO_DONATION_LINK": "Donation link:",
|
||||
"MENU_SYSINFO_DONATION_URL": "https://paypal.me/fedecek"
|
||||
}
|
38
data/cdata/localizedstrings/english_safe.json
Normal file
38
data/cdata/localizedstrings/english_safe.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"MENU_MODS_DESC": "Load installed mods.",
|
||||
"LUA_MENU_MOD_DESC_DEFAULT": "Load &&1.",
|
||||
"LUA_MENU_MOD_DESC": "&&1\nAuthor: &&2\nVersion: &&3",
|
||||
"LUA_MENU_LOADED_MOD": "Loaded mod: ^3&&1",
|
||||
"LUA_MENU_AVAILABLE_MODS": "Available mods",
|
||||
"LUA_MENU_UNLOAD": "Unload",
|
||||
"LUA_MENU_UNLOAD_DESC": "Unload the currently loaded mod.",
|
||||
"LUA_MENU_WORKSHOP": "Workshop",
|
||||
"LUA_MENU_WORKSHOP_DESC": "Download and install mods.",
|
||||
|
||||
"MENU_GENERAL": "H2-MOD",
|
||||
"MENU_GENERAL_DESC": "Set h2-mod's settings.",
|
||||
"LUA_MENU_AUTO_UPDATE": "Automatic updates",
|
||||
"LUA_MENU_AUTO_UPDATE_DESC": "Enable or disable automatic updates on startup.",
|
||||
"LUA_MENU_CHECK_UPDATES": "Check for updates",
|
||||
"LUA_MENU_CHECK_UPDATES_DESC": "Check for updates.",
|
||||
"LUA_MENU_DRAWING": "Hud",
|
||||
"LUA_MENU_UPDATES": "Updates",
|
||||
"LUA_MENU_RENDERING": "Rendering",
|
||||
"LUA_MENU_DRAW_FPS": "Draw FPS",
|
||||
"LUA_MENU_DRAW_FPS_DESC": "Enable or disable drawing fps or viewpos on screen.",
|
||||
"LUA_MENU_FPS_ONLY": "FPS only",
|
||||
"LUA_MENU_FPS_AND_VIEWPOS": "FPS and View Pos",
|
||||
"LUA_MENU_DRAW_SPEED": "Draw speed",
|
||||
"LUA_MENU_DRAW_SPEED_DESC": "Enable or disable drawing the player speed on screen.",
|
||||
"LUA_MENU_DRAW_SPEEDGRAPH": "Draw speed graph",
|
||||
"LUA_MENU_DRAW_SPEEDGRAPH_DESC": "Enable or disable the speed graph.",
|
||||
"LUA_MENU_R_FULLBRIGHT": "Fullbright",
|
||||
"LUA_MENU_R_FULLBRIGHT_DESC": "Change the fullbright mode",
|
||||
"LUA_MENU_MODE2": "No dynamic lighting",
|
||||
"LUA_MENU_MODE3": "Debug shader",
|
||||
|
||||
"MENU_SYSINFO_CUSTOMER_SUPPORT_LINK": "Github Page:",
|
||||
"MENU_SYSINFO_CUSTOMER_SUPPORT_URL": "https://github.com/fedddddd/h2-mod",
|
||||
"MENU_SYSINFO_DONATION_LINK": "Donation link:",
|
||||
"MENU_SYSINFO_DONATION_URL": "https://paypal.me/fedecek"
|
||||
}
|
38
data/cdata/localizedstrings/italian.json
Normal file
38
data/cdata/localizedstrings/italian.json
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"MENU_MODS_DESC": "Abilita mod installate.",
|
||||
"LUA_MENU_MOD_DESC_DEFAULT": "Abilita &&1.",
|
||||
"LUA_MENU_MOD_DESC": "&&1\nAutore: &&2\nVersione: &&3",
|
||||
"LUA_MENU_LOADED_MOD": "Mod attiva: ^3&&1",
|
||||
"LUA_MENU_AVAILABLE_MODS": "Mod disponibili",
|
||||
"LUA_MENU_UNLOAD": "Disabilita",
|
||||
"LUA_MENU_UNLOAD_DESC": "Disabilita la mod attualmente attiva.",
|
||||
"LUA_MENU_WORKSHOP": "Workshop",
|
||||
"LUA_MENU_WORKSHOP_DESC": "Scarica e installa mod.",
|
||||
|
||||
"MENU_GENERAL": "H2-MOD",
|
||||
"MENU_GENERAL_DESC": "Imposta le opzioni di h2-mod.",
|
||||
"LUA_MENU_AUTO_UPDATE": "Aggiornamenti automatici",
|
||||
"LUA_MENU_AUTO_UPDATE_DESC": "Controlla automaticamente gli aggiornamenti all'avvio.",
|
||||
"LUA_MENU_CHECK_UPDATES": "Controlla gli aggiornamenti",
|
||||
"LUA_MENU_CHECK_UPDATES_DESC": "Controlla gli aggiornamenti.",
|
||||
"LUA_MENU_DRAWING": "Hud",
|
||||
"LUA_MENU_UPDATES": "Aggiornamenti",
|
||||
"LUA_MENU_RENDERING": "Rendering",
|
||||
"LUA_MENU_DRAW_FPS": "Mostra FPS",
|
||||
"LUA_MENU_DRAW_FPS_DESC": "Mostra gli FPS o la posizione sullo schermo.",
|
||||
"LUA_MENU_FPS_ONLY": "Solo FPS",
|
||||
"LUA_MENU_FPS_AND_VIEWPOS": "FPS e Posizione",
|
||||
"LUA_MENU_DRAW_SPEED": "Mostra la velocità",
|
||||
"LUA_MENU_DRAW_SPEED_DESC": "Mostra la velocità sullo schermo.",
|
||||
"LUA_MENU_DRAW_SPEEDGRAPH": "Mostra il grafico della velocità",
|
||||
"LUA_MENU_DRAW_SPEEDGRAPH_DESC": "Attiva o disattiva il grafico della velocità.",
|
||||
"LUA_MENU_R_FULLBRIGHT": "Fullbright",
|
||||
"LUA_MENU_R_FULLBRIGHT_DESC": "Cambia la modalità di fullbright",
|
||||
"LUA_MENU_MODE2": "No illuminazione dinamica",
|
||||
"LUA_MENU_MODE3": "Shader di debug",
|
||||
|
||||
"MENU_SYSINFO_CUSTOMER_SUPPORT_LINK": "Pagina di Github:",
|
||||
"MENU_SYSINFO_CUSTOMER_SUPPORT_URL": "https://github.com/fedddddd/h2-mod",
|
||||
"MENU_SYSINFO_DONATION_LINK": "Link per donazioni:",
|
||||
"MENU_SYSINFO_DONATION_URL": "https://paypal.me/fedecek"
|
||||
}
|
BIN
data/cdata/polrus/fonts/bank.ttf
Normal file
BIN
data/cdata/polrus/fonts/bank.ttf
Normal file
Binary file not shown.
BIN
data/cdata/polrus/fonts/default.otf
Normal file
BIN
data/cdata/polrus/fonts/default.otf
Normal file
Binary file not shown.
BIN
data/cdata/polrus/fonts/defaultBold.otf
Normal file
BIN
data/cdata/polrus/fonts/defaultBold.otf
Normal file
Binary file not shown.
92
data/cdata/ui_scripts/branding/__init__.lua
Normal file
92
data/cdata/ui_scripts/branding/__init__.lua
Normal file
@ -0,0 +1,92 @@
|
||||
local spacing = 10
|
||||
local topoffset = 15
|
||||
|
||||
local extrawidth = 50
|
||||
local extraheight = 40
|
||||
|
||||
LUI.MenuBuilder.m_types_build["SystemInfo"] = function (f6_arg0, f6_arg1)
|
||||
local f6_local0 = LUI.MenuTemplate.spMenuOffset
|
||||
local title = "LUA_MENU_SYSTEM_INFO_CAPS"
|
||||
|
||||
local f6_local2 = false
|
||||
local f6_local3 = 0
|
||||
|
||||
local menu = LUI.MenuTemplate.new(f6_arg0, {
|
||||
menu_title = title,
|
||||
menu_top_indent = f6_local0 + f6_local3,
|
||||
showSelectButton = false,
|
||||
skipAnim = f6_local2
|
||||
})
|
||||
|
||||
menu:setClass(LUI.SystemInfo)
|
||||
menu:PopulateMissingProps(f6_arg1)
|
||||
menu:ValidateProps(f6_arg1)
|
||||
menu.id = "systemInfo_id"
|
||||
|
||||
local f6_local5 = 300
|
||||
local f6_local6 = LUI.MenuTemplate.ListTop + f6_local0
|
||||
local f6_local7 = f6_arg1.menu_height
|
||||
if not f6_local7 then
|
||||
f6_local7 = f6_local5
|
||||
end
|
||||
|
||||
f6_local7 = f6_local7 + f6_local6 - extraheight
|
||||
|
||||
local f6_local9 = luiglobals.GenericMenuDims.OptionMenuWidth + 100
|
||||
local f6_local10 = menu.properties
|
||||
local topoffset2 = LUI.MenuTemplate.ListTop + LUI.MenuTemplate.spMenuOffset
|
||||
|
||||
local decobox = LUI.MenuBuilder.BuildRegisteredType("h1_box_deco", {
|
||||
decoTopOffset = topoffset2 - topoffset + 15,
|
||||
decoBottomOffset = -f6_local7,
|
||||
decoRightOffset = -665 + extrawidth
|
||||
})
|
||||
|
||||
menu:addElement(decobox)
|
||||
|
||||
local decoleft = CoD.CreateState(0, 0.5, 8, 0.5, CoD.AnchorTypes.TopLeft)
|
||||
decoleft.color = luiglobals.Colors.h1.light_grey
|
||||
decobox:addElement(LUI.UILine.new(decoleft))
|
||||
|
||||
local decoright = CoD.CreateState(0, 0.5, -8, 0.5, CoD.AnchorTypes.TopRight)
|
||||
decoright.color = luiglobals.Colors.h1.light_grey
|
||||
decobox:addElement(LUI.UILine.new(decoright))
|
||||
|
||||
local element = LUI.UIVerticalList.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
topAnchor = true,
|
||||
bottomAnchor = true,
|
||||
left = spacing,
|
||||
right = 100,
|
||||
top = topoffset2 + 15,
|
||||
bottom = 0,
|
||||
spacing = spacing * 0.8
|
||||
})
|
||||
|
||||
element.id = "systemInfoList_id"
|
||||
menu.vlist = element
|
||||
menu:addElement(element)
|
||||
|
||||
local optionmenuwidth = luiglobals.GenericMenuDims.OptionMenuWidth
|
||||
luiglobals.GenericMenuDims.OptionMenuWidth = optionmenuwidth + extrawidth
|
||||
|
||||
menu:AddInfo(Engine.Localize("MENU_SYSINFO_VERSION"), function()
|
||||
return Engine.GetBuildNumber()
|
||||
end)
|
||||
|
||||
menu:AddInfo(Engine.Localize("MENU_SYSINFO_CUSTOMER_SUPPORT_LINK"), function()
|
||||
return Engine.Localize("MENU_SYSINFO_CUSTOMER_SUPPORT_URL")
|
||||
end)
|
||||
|
||||
menu:AddInfo(Engine.Localize("MENU_SYSINFO_DONATION_LINK"), function()
|
||||
return Engine.Localize("MENU_SYSINFO_DONATION_URL")
|
||||
end)
|
||||
|
||||
luiglobals.GenericMenuDims.OptionMenuWidth = optionmenuwidth
|
||||
|
||||
menu:AddBackButton()
|
||||
menu:registerEventHandler("menu_close", LUI.SystemInfo.LeaveMenu)
|
||||
|
||||
return menu
|
||||
end
|
1
data/cdata/ui_scripts/mods/__init__.lua
Normal file
1
data/cdata/ui_scripts/mods/__init__.lua
Normal file
@ -0,0 +1 @@
|
||||
require("loading")
|
122
data/cdata/ui_scripts/mods/loading.lua
Normal file
122
data/cdata/ui_scripts/mods/loading.lua
Normal file
@ -0,0 +1,122 @@
|
||||
function createdivider(menu, text)
|
||||
local element = LUI.UIElement.new( {
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 0,
|
||||
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 = Engine.ToUpperCase(text)
|
||||
}))
|
||||
|
||||
element.text = element:getFirstChild():getFirstChild():getNextSibling()
|
||||
|
||||
menu.list:addElement(element)
|
||||
return element
|
||||
end
|
||||
|
||||
function string:truncate(length)
|
||||
if (#self <= length) then
|
||||
return self
|
||||
end
|
||||
|
||||
return self:sub(1, length - 3) .. "..."
|
||||
end
|
||||
|
||||
LUI.addmenubutton("main_campaign", {
|
||||
index = 6,
|
||||
text = "@MENU_MODS",
|
||||
description = Engine.Localize("@MENU_MODS_DESC"),
|
||||
callback = function()
|
||||
LUI.FlowManager.RequestAddMenu(nil, "mods_menu")
|
||||
end
|
||||
})
|
||||
|
||||
function getmodname(path)
|
||||
local name = path
|
||||
game:addlocalizedstring(name, name)
|
||||
local desc = Engine.Localize("LUA_MENU_MOD_DESC_DEFAULT", name)
|
||||
local infofile = path .. "/info.json"
|
||||
|
||||
if (io.fileexists(infofile)) then
|
||||
pcall(function()
|
||||
local data = json.decode(io.readfile(infofile))
|
||||
game:addlocalizedstring(data.description, data.description)
|
||||
game:addlocalizedstring(data.author, data.author)
|
||||
game:addlocalizedstring(data.version, data.version)
|
||||
desc = Engine.Localize("@LUA_MENU_MOD_DESC",
|
||||
data.description, data.author, data.version)
|
||||
name = data.name
|
||||
end)
|
||||
end
|
||||
|
||||
return name, desc
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.registerType("mods_menu", function(a1)
|
||||
local menu = LUI.MenuTemplate.new(a1, {
|
||||
menu_title = "@MENU_MODS",
|
||||
exclusiveController = 0,
|
||||
menu_width = 400,
|
||||
menu_top_indent = LUI.MenuTemplate.spMenuOffset,
|
||||
showTopRightSmallBar = true,
|
||||
uppercase_title = true
|
||||
})
|
||||
|
||||
menu:AddButton("@LUA_MENU_WORKSHOP", function()
|
||||
if (LUI.MenuBuilder.m_types_build["mods_workshop_menu"]) then
|
||||
LUI.FlowManager.RequestAddMenu(nil, "mods_workshop_menu")
|
||||
end
|
||||
end, nil, true, nil, {
|
||||
desc_text = Engine.Localize("@LUA_MENU_WORKSHOP_DESC")
|
||||
})
|
||||
|
||||
local modfolder = game:getloadedmod()
|
||||
if (modfolder ~= "") then
|
||||
local name = getmodname(modfolder)
|
||||
createdivider(menu, Engine.Localize("@LUA_MENU_LOADED_MOD", name:truncate(24)))
|
||||
|
||||
menu:AddButton("@LUA_MENU_UNLOAD", function()
|
||||
Engine.Exec("unloadmod")
|
||||
end, nil, true, nil, {
|
||||
desc_text = Engine.Localize("@LUA_MENU_UNLOAD_DESC")
|
||||
})
|
||||
end
|
||||
|
||||
createdivider(menu, Engine.Localize("@LUA_MENU_AVAILABLE_MODS"))
|
||||
|
||||
if (io.directoryexists("mods")) then
|
||||
local mods = io.listfiles("mods/")
|
||||
for i = 1, #mods do
|
||||
if (io.directoryexists(mods[i]) and not io.directoryisempty(mods[i])) then
|
||||
local name, desc = getmodname(mods[i])
|
||||
|
||||
if (mods[i] ~= modfolder) then
|
||||
game:addlocalizedstring(name, name)
|
||||
menu:AddButton(name, function()
|
||||
Engine.Exec("loadmod " .. mods[i])
|
||||
end, nil, true, nil, {
|
||||
desc_text = desc
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
menu:AddBackButton(function(a1)
|
||||
Engine.PlaySound(CoD.SFX.MenuBack)
|
||||
LUI.FlowManager.RequestLeaveMenu(a1)
|
||||
end)
|
||||
|
||||
LUI.Options.InitScrollingList(menu.list, nil)
|
||||
menu:CreateBottomDivider()
|
||||
menu.optionTextInfo = LUI.Options.AddOptionTextInfo(menu)
|
||||
|
||||
return menu
|
||||
end)
|
0
data/cdata/ui_scripts/mods/store.lua
Normal file
0
data/cdata/ui_scripts/mods/store.lua
Normal file
0
data/cdata/ui_scripts/patches/__init__.lua
Normal file
0
data/cdata/ui_scripts/patches/__init__.lua
Normal file
154
data/cdata/ui_scripts/settings/__init__.lua
Normal file
154
data/cdata/ui_scripts/settings/__init__.lua
Normal file
@ -0,0 +1,154 @@
|
||||
require("language")
|
||||
|
||||
function createdivider(menu, text)
|
||||
local element = LUI.UIElement.new({
|
||||
leftAnchor = true,
|
||||
rightAnchor = true,
|
||||
left = 0,
|
||||
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 = Engine.ToUpperCase(Engine.Localize(text))
|
||||
}))
|
||||
|
||||
menu.list:addElement(element)
|
||||
end
|
||||
|
||||
LUI.addmenubutton("pc_controls", {
|
||||
index = 4,
|
||||
text = "@MENU_GENERAL",
|
||||
description = Engine.Localize("@MENU_GENERAL_DESC"),
|
||||
callback = function()
|
||||
LUI.FlowManager.RequestAddMenu(nil, "settings_menu")
|
||||
end
|
||||
})
|
||||
|
||||
LUI.MenuBuilder.m_types_build["settings_menu"] = function(a1)
|
||||
local menu = LUI.MenuTemplate.new(a1, {
|
||||
menu_title = "@MENU_GENERAL",
|
||||
menu_list_divider_top_offset = -(LUI.H1MenuTab.tabChangeHoldingElementHeight + H1MenuDims.spacing),
|
||||
menu_width = GenericMenuDims.OptionMenuWidth
|
||||
})
|
||||
|
||||
createdivider(menu, "@LUA_MENU_UPDATES")
|
||||
|
||||
LUI.Options.CreateOptionButton(
|
||||
menu,
|
||||
"cg_auto_update",
|
||||
"@LUA_MENU_AUTO_UPDATE",
|
||||
"@LUA_MENU_AUTO_UPDATE_DESC",
|
||||
{
|
||||
{
|
||||
text = "@LUA_MENU_ENABLED",
|
||||
value = true
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_DISABLED",
|
||||
value = false
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
menu:AddButton("@LUA_MENU_CHECK_UPDATES", function()
|
||||
LUI.tryupdating(false)
|
||||
end, nil, true, nil, {
|
||||
desc_text = Engine.Localize("@LUA_MENU_CHECK_UPDATES_DESC")
|
||||
})
|
||||
|
||||
createdivider(menu, "@LUA_MENU_DRAWING")
|
||||
|
||||
LUI.Options.CreateOptionButton(
|
||||
menu,
|
||||
"cg_drawFps",
|
||||
"@LUA_MENU_DRAW_FPS",
|
||||
"@LUA_MENU_DRAW_FPS_DESC",
|
||||
{
|
||||
{
|
||||
text = "@LUA_MENU_DISABLED",
|
||||
value = 0
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_FPS_ONLY",
|
||||
value = 1
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_FPS_AND_VIEWPOS",
|
||||
value = 2
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
LUI.Options.CreateOptionButton(
|
||||
menu,
|
||||
"cg_drawSpeed",
|
||||
"@LUA_MENU_DRAW_SPEED",
|
||||
"@LUA_MENU_DRAW_SPEED_DESC",
|
||||
{
|
||||
{
|
||||
text = "@LUA_MENU_ENABLED",
|
||||
value = true
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_DISABLED",
|
||||
value = false
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
LUI.Options.CreateOptionButton(
|
||||
menu,
|
||||
"cg_speedGraph",
|
||||
"@LUA_MENU_DRAW_SPEEDGRAPH",
|
||||
"@LUA_MENU_DRAW_SPEEDGRAPH_DESC",
|
||||
{
|
||||
{
|
||||
text = "@LUA_MENU_ENABLED",
|
||||
value = true
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_DISABLED",
|
||||
value = false
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
createdivider(menu, "@LUA_MENU_RENDERING")
|
||||
|
||||
LUI.Options.CreateOptionButton(
|
||||
menu,
|
||||
"r_fullbright",
|
||||
"@LUA_MENU_R_FULLBRIGHT",
|
||||
"@LUA_MENU_R_FULLBRIGHT_DESC",
|
||||
{
|
||||
{
|
||||
text = "@LUA_MENU_DISABLED",
|
||||
value = 0
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_ENABLED",
|
||||
value = 1
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_MODE2",
|
||||
value = 2
|
||||
},
|
||||
{
|
||||
text = "@LUA_MENU_MODE3",
|
||||
value = 3
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
LUI.Options.InitScrollingList(menu.list, nil)
|
||||
LUI.Options.AddOptionTextInfo(menu)
|
||||
|
||||
menu:AddBackButton()
|
||||
|
||||
return menu
|
||||
end
|
214
data/cdata/ui_scripts/settings/language.lua
Normal file
214
data/cdata/ui_scripts/settings/language.lua
Normal file
@ -0,0 +1,214 @@
|
||||
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")
|
||||
game:addlocalizedstring("MENU_russian", "Русский")
|
||||
game:addlocalizedstring("MENU_polish", "Polski")
|
||||
game:addlocalizedstring("MENU_portuguese", "Português")
|
||||
game:addlocalizedstring("MENU_japanese_full", "日本語")
|
||||
game:addlocalizedstring("MENU_japanese_partial", "日本語(一部)")
|
||||
game:addlocalizedstring("MENU_traditional_chinese", "繁體中文")
|
||||
game:addlocalizedstring("MENU_simplified_chinese", "简体中文")
|
||||
game:addlocalizedstring("MENU_arabic", "العربية")
|
||||
game:addlocalizedstring("MENU_czech", "České") -- ??
|
||||
game:addlocalizedstring("MENU_spanishna", "Español (México)") -- text only (English dubbing)
|
||||
game:addlocalizedstring("MENU_korean", "한국어")
|
||||
game:addlocalizedstring("MENU_english_safe", "English (Safe)")
|
||||
game:addlocalizedstring("MENU_russian_partial", "Русский (Только текст)") -- text only (English dubbing)
|
||||
|
||||
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
|
||||
})
|
||||
|
||||
local factory = LUI.UIGenericButton.ButtonLabelFactory
|
||||
local overrideyoffset = nil
|
||||
LUI.UIGenericButton.ButtonLabelFactory = function(data, ...)
|
||||
if (overrideyoffset) then
|
||||
data.yOffset = overrideyoffset
|
||||
overrideyoffset = nil
|
||||
end
|
||||
|
||||
return factory(data, ...)
|
||||
end
|
||||
|
||||
local arabicfont = RegisterFont("fonts/arabic.ttf", 30)
|
||||
local koreanfont = RegisterFont("fonts/korean.ttf", 30)
|
||||
local polrusfont = RegisterFont("polrus/fonts/default.otf", 30)
|
||||
local japanesefont = RegisterFont("fonts/japanese.ttf", 30)
|
||||
local chinesefont = RegisterFont("fonts/chinese.ttf", 30)
|
||||
|
||||
local function setchinesefont(lang)
|
||||
if (lang ~= CoD.Language.Traditional_chinese and lang ~= CoD.Language.Simplified_chinese) then
|
||||
return
|
||||
end
|
||||
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Font = chinesefont
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Height = 22
|
||||
overrideyoffset = 1
|
||||
end
|
||||
|
||||
local function setjapanesefont(lang)
|
||||
if (lang ~= CoD.Language.Japanese_full and lang ~= CoD.Language.Japanese_partial) then
|
||||
return
|
||||
end
|
||||
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Font = japanesefont
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Height = 18
|
||||
overrideyoffset = 1
|
||||
end
|
||||
|
||||
local function setkoreanfont(lang)
|
||||
if (lang ~= CoD.Language.Korean) then
|
||||
return
|
||||
end
|
||||
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Font = koreanfont
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Height = 25
|
||||
overrideyoffset = 1
|
||||
end
|
||||
|
||||
local function setarabicfont(lang)
|
||||
if (lang ~= CoD.Language.Arabic) then
|
||||
return
|
||||
end
|
||||
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Font = arabicfont
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Height = 28
|
||||
overrideyoffset = 0
|
||||
end
|
||||
|
||||
local function setpolrusfont(lang)
|
||||
if (lang ~= CoD.Language.Russian and lang ~= CoD.Language.Russian_partial and lang ~= CoD.Language.Polish) then
|
||||
return
|
||||
end
|
||||
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Font = polrusfont
|
||||
overrideyoffset = 2.5
|
||||
end
|
||||
|
||||
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),
|
||||
menu_width = 300,
|
||||
uppercase_title = true
|
||||
})
|
||||
|
||||
local languages = Engine.GetSupportedLanguages()
|
||||
|
||||
for i = 1, #languages do
|
||||
local prevfont = LUI.MenuGenericButtons.ButtonLabelFont.Font
|
||||
local prevheight = LUI.MenuGenericButtons.ButtonLabelFont.Height
|
||||
local id = languages[i].id
|
||||
|
||||
local lang = Engine.GetCurrentLanguage()
|
||||
|
||||
if (lang == CoD.Language.Traditional_chinese or lang == CoD.Language.Simplified_chinese) then
|
||||
setjapanesefont(id)
|
||||
setkoreanfont(id)
|
||||
setarabicfont(id)
|
||||
elseif (lang == CoD.Language.Japanese_full or lang == CoD.Language.Japanese_partial) then
|
||||
setchinesefont(id)
|
||||
setkoreanfont(id)
|
||||
setarabicfont(id)
|
||||
elseif (lang ~= CoD.Language.Arabic and lang ~= CoD.Language.Korean) then
|
||||
setpolrusfont(id)
|
||||
setchinesefont(id)
|
||||
setjapanesefont(id)
|
||||
setkoreanfont(id)
|
||||
setarabicfont(id)
|
||||
end
|
||||
|
||||
local button = menu:AddButton("", function()
|
||||
if (languages[i].id == Engine.GetCurrentLanguage()) then
|
||||
LUI.FlowManager.RequestLeaveMenu(nil, "choose_language_menu")
|
||||
return
|
||||
end
|
||||
|
||||
LUI.FlowManager.RequestAddMenu(nil, "choose_language_confirm_popup", false, nil, true, {
|
||||
language = languages[i].id
|
||||
})
|
||||
end)
|
||||
|
||||
overrideyoffset = nil
|
||||
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Font = prevfont
|
||||
LUI.MenuGenericButtons.ButtonLabelFont.Height = prevheight
|
||||
|
||||
local label = button:getFirstDescendentById("text_label")
|
||||
label:setText(Engine.ToUpperCase(languages[i].name))
|
||||
end
|
||||
|
||||
LUI.Options.InitScrollingList(menu.list, nil, {
|
||||
rows = 11
|
||||
})
|
||||
menu:AddBackButton()
|
||||
|
||||
return menu
|
||||
end)
|
||||
|
||||
-- rus/pol patches
|
||||
|
||||
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
|
||||
local res = weaponinfodef(...)
|
||||
CoD.Language.Russian = rus
|
||||
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
|
||||
local res = setupinfobox(...)
|
||||
CoD.Language.Russian = rus
|
||||
return res
|
||||
end
|
||||
end
|
||||
|
||||
LUI.UIButtonText.IsOffsetedLanguage = function()
|
||||
if Engine.IsRightToLeftLanguage() then
|
||||
return true
|
||||
elseif Engine.IsAsianLanguage() then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local lang = Engine.GetCurrentLanguage()
|
||||
if (lang == 5 or lang == 6 or lang == 17) then
|
||||
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)
|
||||
}
|
||||
end
|
Reference in New Issue
Block a user