Disable useless things (#153)

This commit is contained in:
ジョク アーウェント 2022-07-03 18:19:57 +02:00 committed by GitHub
parent 04b6542bdf
commit 272094f76d
3 changed files with 36 additions and 0 deletions

View File

@ -6,6 +6,7 @@ if (Engine.InFrontend()) then
require("shaderdialog")
require("gamemodes")
require("no_mode_switch")
require("disable_useless_things")
end
-- defined in mp_hud/hudutils.lua

View 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() then
LUI.removemenubutton("pc_controls", 4)
end
-- Remove social button
LUI.MenuBuilder.m_definitions["online_friends_widget"] = function()
return {
type = "UIElement"
}
end

View File

@ -147,6 +147,24 @@ LUI.addmenubutton = function(name, data)
end)
end
LUI.removemenubutton = function(name, index)
LUI.onmenuopen(name, function(menu)
if (not menu.list) then
return
end
local buttonlist = menu:getChildById(menu.type .. "_list")
local button = buttonlist.childRecord[string.format("%s_button_%s", name, index)]
buttonlist:removeElement(button)
local hintbox = menu.optionTextInfo
menu:removeElement(hintbox)
LUI.Options.InitScrollingList(menu.list, nil)
menu.optionTextInfo = LUI.Options.AddOptionTextInfo(menu)
end)
end
LUI.openmenu = function(menu, args)
stack = args
LUI.FlowManager.RequestAddMenu(nil, menu)