add new data directory, and update updater
This commit is contained in:
20
data/cdata/ui_scripts/patches/__init__.lua
Normal file
20
data/cdata/ui_scripts/patches/__init__.lua
Normal file
@ -0,0 +1,20 @@
|
||||
if (game:issingleplayer()) then
|
||||
return
|
||||
end
|
||||
|
||||
if (Engine.InFrontend()) then
|
||||
require("shaderdialog")
|
||||
require("gamemodes")
|
||||
require("no_mode_switch")
|
||||
require("disable_useless_things")
|
||||
end
|
||||
|
||||
-- defined in mp_hud/hudutils.lua
|
||||
function GetGameModeName()
|
||||
return Engine.Localize(Engine.TableLookup(GameTypesTable.File,
|
||||
GameTypesTable.Cols.Ref, GameX.GetGameMode(), GameTypesTable.Cols.Name))
|
||||
end
|
||||
|
||||
function NeverAllowChangeTeams()
|
||||
return false
|
||||
end
|
17
data/cdata/ui_scripts/patches/disable_useless_things.lua
Normal file
17
data/cdata/ui_scripts/patches/disable_useless_things.lua
Normal file
@ -0,0 +1,17 @@
|
||||
-- Disable CP
|
||||
Engine.SetDvarInt("ui_enable_cp", 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)
|
||||
end
|
||||
|
||||
-- Remove social button
|
||||
LUI.MenuBuilder.m_definitions["online_friends_widget"] = function()
|
||||
return {
|
||||
type = "UIElement"
|
||||
}
|
||||
end
|
11
data/cdata/ui_scripts/patches/gamemodes.lua
Normal file
11
data/cdata/ui_scripts/patches/gamemodes.lua
Normal file
@ -0,0 +1,11 @@
|
||||
Cac.GameModes.Data = {
|
||||
Standard = {
|
||||
Label = Engine.Localize("@MPUI_STANDARD_CAPS"),
|
||||
Image = "h1_ui_icon_playlist_standard",
|
||||
List =
|
||||
{
|
||||
"dm", "war", "sd", "dom", "conf", "sab", "koth", "hp", "gun",
|
||||
"dd", "ctf" -- missing gamemodes from UI
|
||||
}
|
||||
}
|
||||
}
|
13
data/cdata/ui_scripts/patches/no_mode_switch.lua
Normal file
13
data/cdata/ui_scripts/patches/no_mode_switch.lua
Normal file
@ -0,0 +1,13 @@
|
||||
LUI.MenuBuilder.m_definitions["main_choose_exe_popup_menu"] = function()
|
||||
return {
|
||||
type = "generic_yesno_popup",
|
||||
id = "main_choose_exe_popup_menu_id",
|
||||
properties = {
|
||||
popup_title = Engine.Localize("@MENU_NOTICE"),
|
||||
message_text = Engine.Localize("@MENU_QUIT_WARNING"),
|
||||
yes_action = function()
|
||||
Engine.Quit()
|
||||
end
|
||||
}
|
||||
}
|
||||
end
|
25
data/cdata/ui_scripts/patches/shader_dialog.lua
Normal file
25
data/cdata/ui_scripts/patches/shader_dialog.lua
Normal file
@ -0,0 +1,25 @@
|
||||
LUI.MenuBuilder.registerPopupType("ShaderCacheDialog_original", LUI.ShaderCacheDialog.new)
|
||||
|
||||
local function dialog(...)
|
||||
if (game:sharedget("has_accepted_shader_caching") == "1") then
|
||||
return LUI.ShaderCacheDialog.new(...)
|
||||
end
|
||||
|
||||
return LUI.MenuBuilder.BuildRegisteredType("generic_yesno_popup", {
|
||||
popup_title = Engine.Localize("@MENU_WARNING"),
|
||||
message_text = Engine.Localize("@PLATFORM_SHADER_PRECACHE_ASK"),
|
||||
yes_action = function()
|
||||
game:sharedset("has_accepted_shader_caching", "1")
|
||||
LUI.FlowManager.RequestAddMenu(nil, "ShaderCacheDialog_original")
|
||||
end,
|
||||
yes_text = Engine.Localize("@MENU_YES"),
|
||||
no_text = Engine.Localize("@MENU_NO_DONT_ASK"),
|
||||
no_action = function()
|
||||
Engine.SetDvarInt("r_preloadShadersFrontendAllow", 0)
|
||||
end,
|
||||
default_focus_index = 2,
|
||||
cancel_will_close = false
|
||||
})
|
||||
end
|
||||
|
||||
LUI.MenuBuilder.m_types_build["ShaderCacheDialog"] = dialog
|
Reference in New Issue
Block a user