commit
d0847656bc
@ -2,9 +2,28 @@ if Engine.GetCurrentMap() ~= "core_frontend" then
|
||||
return
|
||||
end
|
||||
|
||||
local utils = require("utils")
|
||||
local enableLobbyMapVote = true -- toggle map vote in public lobby
|
||||
local enableLargeServerBrowserButton = true -- toggle large server browser button
|
||||
|
||||
CoD.LobbyButtons.MP_STATS = {
|
||||
local utils = require("utils")
|
||||
require("datasources_start_menu_tabs")
|
||||
require("datasources_change_map_categories")
|
||||
require("datasources_gamesettingsflyout_buttons")
|
||||
|
||||
CoD.LobbyButtons.MP_PUBLIC_MATCH = {
|
||||
stringRef = "MENU_PLAY_CAPS",
|
||||
action = NavigateToLobby_SelectionList,
|
||||
param = "MPLobbyOnline",
|
||||
customId = "btnPublicMatch",
|
||||
}
|
||||
|
||||
CoD.LobbyButtons.MP_FIND_MATCH = {
|
||||
stringRef = "MPUI_BASICTRAINING_CAPS",
|
||||
action = OpenFindMatch,
|
||||
customId = "btnFindMatch",
|
||||
}
|
||||
|
||||
CoD.LobbyButtons.STATS = {
|
||||
stringRef = "STATS",
|
||||
action = function(self, element, controller, param, menu)
|
||||
SetPerControllerTableProperty(controller, "disableGameSettingsOptions", true)
|
||||
@ -31,17 +50,48 @@ CoD.LobbyButtons.SETTING_UP_BOTS = {
|
||||
customId = "btnSettingUpBots"
|
||||
}
|
||||
|
||||
CoD.LobbyButtons.MP_CUSTOM_SETUP_GAME = {
|
||||
CoD.LobbyButtons.GameSettingsFlyoutArenas = {
|
||||
stringRef = "MPUI_SETUP_GAME_CAPS",
|
||||
action = OpenSetupGameMP,
|
||||
customId = "btnSetupGame",
|
||||
action = function(self, element, controller, param, menu)
|
||||
SetPerControllerTableProperty(controller, "disableGameSettingsOptions", true)
|
||||
OpenPopup(menu, "GameSettingsFlyoutMP", controller)
|
||||
end,
|
||||
customId = "btnGameSettingsFlyoutMP"
|
||||
}
|
||||
|
||||
local shouldShowMapVote = false
|
||||
CoD.LobbyButtons.GameSettingsFlyoutMP = {
|
||||
stringRef = "MPUI_SETUP_GAME_CAPS",
|
||||
action = function(self, element, controller, param, menu)
|
||||
SetPerControllerTableProperty(controller, "disableGameSettingsOptions", true)
|
||||
OpenPopup(menu, "GameSettingsFlyoutMPCustom", controller)
|
||||
end,
|
||||
customId = "btnGameSettingsFlyoutMPCustom"
|
||||
}
|
||||
|
||||
CoD.LobbyButtons.SERVER_BROWSER = {
|
||||
stringRef = "MENU_SERVER_BROWSER_CAPS",
|
||||
action = function(self, element, controller, param, menu)
|
||||
SetPerControllerTableProperty(controller, "disableGameSettingsOptions", true)
|
||||
OpenPopup(menu, "LobbyServerBrowserOnline", controller)
|
||||
end,
|
||||
customId = "btnDedicated"
|
||||
}
|
||||
|
||||
local shouldShowMapVote = enableLobbyMapVote
|
||||
local lobbyMapVote = function(lobbyMapVoteIsEnabled)
|
||||
if lobbyMapVoteIsEnabled == true then
|
||||
Engine.Exec(nil, "LobbyStopDemo")
|
||||
end
|
||||
end
|
||||
|
||||
local addCustomButtons = function(controller, menuId, buttonTable, isLeader)
|
||||
if menuId == LobbyData.UITargets.UI_MPLOBBYMAIN.id then
|
||||
utils.RemoveSpaces(buttonTable)
|
||||
utils.AddSpacer(buttonTable, utils.GetButtonIndex(buttonTable, CoD.LobbyButtons.THEATER_MP) - 1)
|
||||
end
|
||||
|
||||
if menuId == LobbyData.UITargets.UI_MPLOBBYONLINE.id or menuId == LobbyData.UITargets.UI_ZMLOBBYONLINE.id then
|
||||
utils.AddSpacer(buttonTable)
|
||||
utils.AddSmallButton(controller, buttonTable, CoD.LobbyButtons.MP_STATS)
|
||||
utils.AddSmallButton(controller, buttonTable, CoD.LobbyButtons.STATS)
|
||||
end
|
||||
|
||||
if menuId == LobbyData.UITargets.UI_MPLOBBYONLINE.id or menuId == LobbyData.UITargets.UI_ZMLOBBYONLINE.id or menuId == LobbyData.UITargets.UI_MPLOBBYMAIN.id or menuId == LobbyData.UITargets.UI_MPLOBBYLANGAME.id then
|
||||
@ -49,21 +99,34 @@ local addCustomButtons = function(controller, menuId, buttonTable, isLeader)
|
||||
end
|
||||
|
||||
if menuId == LobbyData.UITargets.UI_MPLOBBYONLINE.id then
|
||||
shouldShowMapVote = true
|
||||
elseif menuId == LobbyData.UITargets.UI_MPLOBBYONLINEPUBLICGAME.id then
|
||||
if shouldShowMapVote == true then
|
||||
shouldShowMapVote = false
|
||||
--Enable map vote at start lobby
|
||||
Engine.Exec(nil, "LobbyStopDemo")
|
||||
shouldShowMapVote = enableLobbyMapVote
|
||||
if enableLargeServerBrowserButton then
|
||||
utils.AddLargeButton(controller, buttonTable, CoD.LobbyButtons.SERVER_BROWSER, 1)
|
||||
end
|
||||
utils.AddLargeButton(controller, buttonTable, CoD.LobbyButtons.MP_START_GAME, 1) --Launch match button
|
||||
utils.AddSpacer(buttonTable, 1)
|
||||
elseif menuId == LobbyData.UITargets.UI_MPLOBBYONLINEPUBLICGAME.id then
|
||||
utils.RemoveButton(buttonTable, CoD.LobbyButtons.MP_PUBLIC_LOBBY_LEADERBOARD)
|
||||
|
||||
utils.AddSpacer(buttonTable)
|
||||
utils.AddSmallButton(controller, buttonTable, CoD.LobbyButtons.MP_CUSTOM_SETUP_GAME) --Setup game in public lobby
|
||||
utils.AddLargeButton(controller, buttonTable, CoD.LobbyButtons.MP_START_GAME, 1)
|
||||
utils.AddSmallButton(controller, buttonTable, CoD.LobbyButtons.GameSettingsFlyoutMP, 2)
|
||||
utils.AddSpacer(buttonTable, utils.GetButtonIndex(buttonTable, CoD.LobbyButtons.GameSettingsFlyoutMP))
|
||||
|
||||
lobbyMapVote(shouldShowMapVote)
|
||||
shouldShowMapVote = false
|
||||
elseif menuId == LobbyData.UITargets.UI_MPLOBBYONLINEARENAGAME.id then
|
||||
utils.AddSpacer(buttonTable)
|
||||
utils.AddSmallButton(controller, buttonTable, CoD.LobbyButtons.SETTING_UP_BOTS) --Bot setting button in public lobby
|
||||
utils.AddLargeButton(controller, buttonTable, CoD.LobbyButtons.MP_START_GAME, 1)
|
||||
utils.AddSmallButton(controller, buttonTable, CoD.LobbyButtons.GameSettingsFlyoutArenas, 2)
|
||||
|
||||
utils.AddSpacer(buttonTable, utils.GetButtonIndex(buttonTable, CoD.LobbyButtons.GameSettingsFlyoutArenas))
|
||||
end
|
||||
|
||||
if menuId == LobbyData.UITargets.UI_ZMLOBBYONLINE.id then
|
||||
utils.RemoveButton(buttonTable, CoD.LobbyButtons.THEATER_ZM)
|
||||
utils.AddLargeButton(controller, buttonTable, CoD.LobbyButtons.THEATER_ZM, #buttonTable + 1)
|
||||
|
||||
utils.RemoveSpaces(buttonTable)
|
||||
utils.AddSpacer(buttonTable, utils.GetButtonIndex(buttonTable, CoD.LobbyButtons.SERVER_BROWSER))
|
||||
utils.AddSpacer(buttonTable, utils.GetButtonIndex(buttonTable, CoD.LobbyButtons.ZM_BUBBLEGUM_BUFFS) - 1)
|
||||
utils.AddSpacer(buttonTable, utils.GetButtonIndex(buttonTable, CoD.LobbyButtons.STATS))
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -0,0 +1,96 @@
|
||||
local f0_local0 = function(f1_arg0, f1_arg1)
|
||||
if not CoD.useMouse then
|
||||
return
|
||||
else
|
||||
LUI.OverrideFunction_CallOriginalFirst(f1_arg0, "setState", function(element, controller)
|
||||
if IsSelfInState(f1_arg0, "SelectingMap") then
|
||||
f1_arg0.mapList:setMouseDisabled(false)
|
||||
f1_arg0.mapCategoriesList:setMouseDisabled(true)
|
||||
f1_arg0.m_categorySet = false
|
||||
else
|
||||
f1_arg0.mapList:setMouseDisabled(true)
|
||||
f1_arg0.mapCategoriesList:setMouseDisabled(false)
|
||||
end
|
||||
end)
|
||||
f1_arg0.mapList:setMouseDisabled(true)
|
||||
f1_arg0.mapList:registerEventHandler("leftclick_outside", function(element, event)
|
||||
if IsSelfInState(f1_arg0, "SelectingMap") and f1_arg0.m_categorySet then
|
||||
CoD.PCUtil.SimulateButtonPress(f1_arg1, Enum.LUIButton.LUI_KEY_XBB_PSCIRCLE)
|
||||
end
|
||||
f1_arg0.m_categorySet = true
|
||||
return true
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local PostLoadFunc = function(f4_arg0, f4_arg1)
|
||||
f0_local0(f4_arg0, f4_arg1)
|
||||
end
|
||||
|
||||
local f0_local2 = 10000
|
||||
local f0_local3 = 10001
|
||||
local f0_local4 = function(f5_arg0)
|
||||
local f5_local0 = CoD.mapsTable[f5_arg0]
|
||||
if CoD.CONTENT_DLC6_INDEX <= f5_local0.dlc_pack or f5_arg0 == "mp_redwood_ice" or f5_arg0 == "mp_veiled_heyday" then
|
||||
return f0_local3
|
||||
elseif f5_local0.dlc_pack > 0 then
|
||||
return f0_local2
|
||||
else
|
||||
return f5_local0.dlc_pack
|
||||
end
|
||||
end
|
||||
|
||||
DataSources.ChangeMapCategories = DataSourceHelpers.ListSetup("ChangeMapCategories", function(f6_arg0)
|
||||
local f6_local0 = {}
|
||||
local f6_local1 = CoD.GetMapValue(Engine.DvarString(nil, "ui_mapname"), "dlc_pack", CoD.CONTENT_ORIGINAL_MAP_INDEX)
|
||||
local f6_local2 = function(f7_arg0, f7_arg1)
|
||||
return {
|
||||
models = {
|
||||
text = Engine.Localize("MPUI_MAP_CATEGORY_" .. f7_arg0 .. "_CAPS"),
|
||||
buttonText = Engine.Localize("MPUI_MAP_CATEGORY_" .. f7_arg0 .. "_CAPS"),
|
||||
image = "playlist_map",
|
||||
description = Engine.Localize("MPUI_MAP_CATEGORY_" .. f7_arg0 .. "_DESC")
|
||||
},
|
||||
properties = {
|
||||
category = f7_arg1,
|
||||
selectIndex = f6_local1 == f7_arg1
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
CoD.mapsTable = Engine.GetGDTMapsTable()
|
||||
local f6_local3 = function(f8_arg0)
|
||||
for f8_local3, f8_local4 in pairs(CoD.mapsTable) do
|
||||
if f8_local4.session_mode == CoD.gameModeEnum and f0_local4(f8_local3) == f8_arg0 and (ShowPurchasableMap(f6_arg0, f8_local3) or Engine.IsMapValid(f8_local3)) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
if CoD.isCampaign == true then
|
||||
table.insert(f6_local0, f6_local2("missions", CoD.CONTENT_ORIGINAL_MAP_INDEX))
|
||||
table.insert(f6_local0, f6_local2("dev", CoD.CONTENT_DEV_MAP_INDEX))
|
||||
else
|
||||
table.insert(f6_local0, f6_local2("standard", CoD.CONTENT_ORIGINAL_MAP_INDEX))
|
||||
if not Dvar.ui_execdemo:get() and f6_local3(f0_local2) then
|
||||
table.insert(f6_local0, f6_local2("dlc", f0_local2))
|
||||
end
|
||||
if not Dvar.ui_execdemo:get() and f6_local3(f0_local3) then
|
||||
table.insert(f6_local0, f6_local2("dlc_bonus", f0_local3))
|
||||
end
|
||||
if Mods_Enabled() then --and Engine.Mods_Lists_GetInfoEntries( LuaEnums.USERMAP_BASE_PATH, 0, Engine.Mods_Lists_GetInfoEntriesCount( LuaEnums.USERMAP_BASE_PATH ) ) ~= nil then
|
||||
local f9_local11 = Engine.Mods_Lists_GetInfoEntries(LuaEnums.USERMAP_BASE_PATH, 0,
|
||||
Engine.Mods_Lists_GetInfoEntriesCount(LuaEnums.USERMAP_BASE_PATH))
|
||||
if f9_local11 then
|
||||
for f9_local12 = 0, #f9_local11, 1 do
|
||||
local f9_local17 = f9_local11[f9_local12]
|
||||
if LUI.startswith(f9_local17.internalName, "mp_") then
|
||||
table.insert(f6_local0, f6_local2("mods", CoD.CONTENT_MODS_INDEX))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return f6_local0
|
||||
end, true)
|
@ -0,0 +1,260 @@
|
||||
local f0_local0 = function(f1_arg0, f1_arg1)
|
||||
if not CoD.useMouse then
|
||||
return
|
||||
else
|
||||
f1_arg0.Options:setHandleMouse(true)
|
||||
f1_arg0.Options:registerEventHandler("leftclick_outside", function(element, event)
|
||||
CoD.PCUtil.SimulateButtonPress(event.controller, Enum.LUIButton.LUI_KEY_XBB_PSCIRCLE)
|
||||
return true
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local PostLoadFunc = function(f3_arg0, f3_arg1)
|
||||
f0_local0(f3_arg0, f3_arg1)
|
||||
f3_arg0.disableBlur = true
|
||||
f3_arg0.disablePopupOpenCloseAnim = true
|
||||
Engine.SetModelValue(Engine.CreateModel(Engine.GetGlobalModel(), "GameSettingsFlyoutOpen"), true)
|
||||
LUI.OverrideFunction_CallOriginalSecond(f3_arg0, "close", function(element)
|
||||
Engine.SetModelValue(Engine.CreateModel(Engine.GetGlobalModel(), "GameSettingsFlyoutOpen"), false)
|
||||
end)
|
||||
f3_arg0:registerEventHandler("occlusion_change", function(element, event)
|
||||
local f5_local0 = element:getParent()
|
||||
if f5_local0 then
|
||||
local f5_local1 = f5_local0:getFirstChild()
|
||||
while f5_local1 ~= nil do
|
||||
if f5_local1.menuName == "Lobby" then
|
||||
break
|
||||
end
|
||||
f5_local1 = f5_local1:getNextSibling()
|
||||
end
|
||||
if f5_local1 then
|
||||
if event.occluded == true then
|
||||
f5_local1:setAlpha(0)
|
||||
end
|
||||
f5_local1:setAlpha(1)
|
||||
end
|
||||
end
|
||||
element:OcclusionChange(event)
|
||||
end)
|
||||
f3_arg0:subscribeToModel(Engine.CreateModel(Engine.GetGlobalModel(), "lobbyRoot.lobbyNav", true), function(model)
|
||||
local f6_local0 = f3_arg0.occludedBy
|
||||
while f6_local0 do
|
||||
if f6_local0.occludedBy ~= nil then
|
||||
f6_local0 = f6_local0.occludedBy
|
||||
end
|
||||
while f6_local0 and f6_local0.menuName ~= "Lobby" do
|
||||
f6_local0 = GoBack(f6_local0, f3_arg1)
|
||||
end
|
||||
Engine.SendClientScriptNotify(f3_arg1, "menu_change" .. Engine.GetLocalClientNum(f3_arg1), "Main",
|
||||
"closeToMenu")
|
||||
return
|
||||
end
|
||||
GoBack(f3_arg0, f3_arg1)
|
||||
end, false)
|
||||
end
|
||||
|
||||
DataSources.GameSettingsFlyoutButtonsCustom = DataSourceHelpers.ListSetup("GameSettingsFlyoutButtonsCustom",
|
||||
function(f7_arg0)
|
||||
local f7_local0 = {
|
||||
{
|
||||
optionDisplay = "MPUI_CHANGE_MAP_CAPS",
|
||||
customId = "btnChangeMap",
|
||||
action = OpenChangeMap
|
||||
},
|
||||
-- {
|
||||
-- optionDisplay = "MPUI_CHANGE_GAME_MODE_CAPS",
|
||||
-- customId = "btnChangeGameMode",
|
||||
-- action = OpenChangeGameMode
|
||||
-- },
|
||||
{
|
||||
optionDisplay = "MENU_SETUP_BOTS_CAPS",
|
||||
customId = "btnSetupBots",
|
||||
action = OpenBotSettings
|
||||
},
|
||||
{
|
||||
optionDisplay = "MPUI_EDIT_GAME_RULES_CAPS",
|
||||
customId = "btnEditGameRules",
|
||||
action = OpenEditGameRules
|
||||
}
|
||||
}
|
||||
-- if CoD.isPC and IsServerBrowserEnabled() then
|
||||
-- table.insert( f7_local0, {
|
||||
-- optionDisplay = "PLATFORM_SERVER_SETTINGS_CAPS",
|
||||
-- customID = "btnServerSettings",
|
||||
-- action = OpenServerSettings
|
||||
-- } )
|
||||
-- end
|
||||
local f7_local1 = {}
|
||||
for f7_local5, f7_local6 in ipairs(f7_local0) do
|
||||
table.insert(f7_local1, {
|
||||
models = {
|
||||
displayText = Engine.Localize(f7_local6.optionDisplay),
|
||||
customId = f7_local6.customId,
|
||||
disabled = f7_local6.disabled
|
||||
},
|
||||
properties = {
|
||||
title = f7_local6.optionDisplay,
|
||||
desc = f7_local6.desc,
|
||||
action = f7_local6.action,
|
||||
actionParam = f7_local6.actionParam
|
||||
}
|
||||
})
|
||||
end
|
||||
return f7_local1
|
||||
end, nil, nil, nil)
|
||||
|
||||
LUI.createMenu.GameSettingsFlyoutMPCustom = function(controller)
|
||||
local self = CoD.Menu.NewForUIEditor("GameSettingsFlyoutMPCustom")
|
||||
if PreLoadFunc then
|
||||
PreLoadFunc(self, controller)
|
||||
end
|
||||
self.soundSet = "default"
|
||||
self:setOwner(controller)
|
||||
self:setLeftRight(true, true, 0, 0)
|
||||
self:setTopBottom(true, true, 0, 0)
|
||||
self:playSound("menu_open", controller)
|
||||
self.buttonModel = Engine.CreateModel(Engine.GetModelForController(controller), "GameSettingsFlyoutMP.buttonPrompts")
|
||||
self.anyChildUsesUpdateState = true
|
||||
|
||||
local Options = LUI.UIList.new(self, controller, -2, 0, nil, false, false, 0, 0, false, false)
|
||||
Options:makeFocusable()
|
||||
Options:setLeftRight(true, false, 243.43, 523.43)
|
||||
Options:setTopBottom(true, false, 177.56, 329.56)
|
||||
Options:setYRot(25)
|
||||
Options:setWidgetType(CoD.FE_List1ButtonLarge_PH)
|
||||
Options:setVerticalCount(3)
|
||||
Options:setSpacing(-2)
|
||||
Options:setDataSource("GameSettingsFlyoutButtonsCustom")
|
||||
Options:registerEventHandler("gain_focus", function(element, event)
|
||||
local f9_local0 = nil
|
||||
if element.gainFocus then
|
||||
f9_local0 = element:gainFocus(event)
|
||||
elseif element.super.gainFocus then
|
||||
f9_local0 = element.super:gainFocus(event)
|
||||
end
|
||||
CoD.Menu.UpdateButtonShownState(element, self, controller, Enum.LUIButton.LUI_KEY_XBA_PSCROSS)
|
||||
return f9_local0
|
||||
end)
|
||||
Options:registerEventHandler("lose_focus", function(element, event)
|
||||
local f10_local0 = nil
|
||||
if element.loseFocus then
|
||||
f10_local0 = element:loseFocus(event)
|
||||
elseif element.super.loseFocus then
|
||||
f10_local0 = element.super:loseFocus(event)
|
||||
end
|
||||
return f10_local0
|
||||
end)
|
||||
self:AddButtonCallbackFunction(Options, controller, Enum.LUIButton.LUI_KEY_XBA_PSCROSS, "ENTER",
|
||||
function(element, menu, controller, model)
|
||||
ProcessListAction(self, element, controller)
|
||||
return true
|
||||
end, function(element, menu, controller)
|
||||
CoD.Menu.SetButtonLabel(menu, Enum.LUIButton.LUI_KEY_XBA_PSCROSS, "MENU_SELECT")
|
||||
return true
|
||||
end, false)
|
||||
self:addElement(Options)
|
||||
self.Options = Options
|
||||
|
||||
self:mergeStateConditions({
|
||||
{
|
||||
stateName = "Local",
|
||||
condition = function(menu, element, event)
|
||||
return IsLobbyNetworkModeLAN()
|
||||
end
|
||||
}
|
||||
})
|
||||
self:subscribeToModel(Engine.GetModel(Engine.GetGlobalModel(), "lobbyRoot.lobbyNetworkMode"), function(model)
|
||||
local f14_local0 = self
|
||||
local f14_local1 = {
|
||||
controller = controller,
|
||||
name = "model_validation",
|
||||
modelValue = Engine.GetModelValue(model),
|
||||
modelName = "lobbyRoot.lobbyNetworkMode"
|
||||
}
|
||||
CoD.Menu.UpdateButtonShownState(f14_local0, self, controller, Enum.LUIButton.LUI_KEY_XBY_PSTRIANGLE)
|
||||
end)
|
||||
self:subscribeToModel(Engine.GetModel(Engine.GetGlobalModel(), "lobbyRoot.lobbyNav"), function(model)
|
||||
local f15_local0 = self
|
||||
local f15_local1 = {
|
||||
controller = controller,
|
||||
name = "model_validation",
|
||||
modelValue = Engine.GetModelValue(model),
|
||||
modelName = "lobbyRoot.lobbyNav"
|
||||
}
|
||||
CoD.Menu.UpdateButtonShownState(f15_local0, self, controller, Enum.LUIButton.LUI_KEY_XBY_PSTRIANGLE)
|
||||
end)
|
||||
self:AddButtonCallbackFunction(self, controller, Enum.LUIButton.LUI_KEY_XBB_PSCIRCLE, nil,
|
||||
function(element, menu, controller, model)
|
||||
GoBack(self, controller)
|
||||
ClearMenuSavedState(menu)
|
||||
return true
|
||||
end, function(element, menu, controller)
|
||||
CoD.Menu.SetButtonLabel(menu, Enum.LUIButton.LUI_KEY_XBB_PSCIRCLE, "")
|
||||
return false
|
||||
end, false)
|
||||
self:AddButtonCallbackFunction(self, controller, Enum.LUIButton.LUI_KEY_START, "M",
|
||||
function(element, menu, controller, model)
|
||||
GoBackAndOpenOverlayOnParent(self, "StartMenu_Main", controller)
|
||||
return true
|
||||
end, function(element, menu, controller)
|
||||
CoD.Menu.SetButtonLabel(menu, Enum.LUIButton.LUI_KEY_START, "MENU_MENU")
|
||||
return true
|
||||
end, false)
|
||||
self:AddButtonCallbackFunction(self, controller, Enum.LUIButton.LUI_KEY_XBY_PSTRIANGLE, "S",
|
||||
function(element, menu, controller, model)
|
||||
if not IsLAN() and not IsPlayerAGuest(controller) and IsPlayerAllowedToPlayOnline(controller) then
|
||||
GoBackAndOpenOverlayOnParent(self, "Social_Main", controller)
|
||||
return true
|
||||
else
|
||||
|
||||
end
|
||||
end, function(element, menu, controller)
|
||||
if not IsLAN() and not IsPlayerAGuest(controller) and IsPlayerAllowedToPlayOnline(controller) then
|
||||
CoD.Menu.SetButtonLabel(menu, Enum.LUIButton.LUI_KEY_XBY_PSTRIANGLE, "")
|
||||
return false
|
||||
else
|
||||
return false
|
||||
end
|
||||
end, false)
|
||||
self:AddButtonCallbackFunction(self, controller, Enum.LUIButton.LUI_KEY_LB, nil,
|
||||
function(element, menu, controller, model)
|
||||
SendButtonPressToOccludedMenu(menu, controller, model, Enum.LUIButton.LUI_KEY_LB)
|
||||
return true
|
||||
end, function(element, menu, controller)
|
||||
CoD.Menu.SetButtonLabel(menu, Enum.LUIButton.LUI_KEY_LB, "")
|
||||
return false
|
||||
end, false)
|
||||
self:AddButtonCallbackFunction(self, controller, Enum.LUIButton.LUI_KEY_RB, nil,
|
||||
function(element, menu, controller, model)
|
||||
SendButtonPressToOccludedMenu(menu, controller, model, Enum.LUIButton.LUI_KEY_RB)
|
||||
return true
|
||||
end, function(element, menu, controller)
|
||||
CoD.Menu.SetButtonLabel(menu, Enum.LUIButton.LUI_KEY_RB, "")
|
||||
return false
|
||||
end, false)
|
||||
Options.id = "Options"
|
||||
self:processEvent({
|
||||
name = "menu_loaded",
|
||||
controller = controller
|
||||
})
|
||||
self:processEvent({
|
||||
name = "update_state",
|
||||
menu = self
|
||||
})
|
||||
if not self:restoreState() then
|
||||
self.Options:processEvent({
|
||||
name = "gain_focus",
|
||||
controller = controller
|
||||
})
|
||||
end
|
||||
LUI.OverrideFunction_CallOriginalSecond(self, "close", function(element)
|
||||
element.Options:close()
|
||||
Engine.UnsubscribeAndFreeModel(Engine.GetModel(Engine.GetModelForController(controller),
|
||||
"GameSettingsFlyoutMP.buttonPrompts"))
|
||||
end)
|
||||
if PostLoadFunc then
|
||||
PostLoadFunc(self, controller)
|
||||
end
|
||||
return self
|
||||
end
|
217
data/ui_scripts/frontend_menus/datasources_start_menu_tabs.lua
Normal file
217
data/ui_scripts/frontend_menus/datasources_start_menu_tabs.lua
Normal file
@ -0,0 +1,217 @@
|
||||
DataSources.StartMenuTabs = ListHelper_SetupDataSource("StartMenuTabs", function(f44_arg0)
|
||||
local f44_local0 = {}
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabIcon = CoD.buttonStrings.shoulderl
|
||||
},
|
||||
properties = {
|
||||
m_mouseDisabled = true
|
||||
}
|
||||
})
|
||||
if Engine.IsDemoPlaying() then
|
||||
local f44_local1 = "CoD.StartMenu_GameOptions"
|
||||
if Engine.IsZombiesGame() then
|
||||
f44_local1 = "CoD.StartMenu_GameOptions_ZM"
|
||||
end
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = Engine.Localize("MENU_THEATER_CAPS"),
|
||||
tabWidget = f44_local1,
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "gameOptions"
|
||||
}
|
||||
})
|
||||
elseif Engine.IsInGame() then
|
||||
if IsGameTypeDOA() and not InSafehouse() then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "DOA",
|
||||
tabWidget = "CoD.StartMenu_GameOptions_DOA",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "gameOptions"
|
||||
}
|
||||
})
|
||||
elseif CoD.isCampaign then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = SessionModeToUnlocalizedSessionModeCaps(Engine.CurrentSessionMode()),
|
||||
tabWidget = "CoD.StartMenu_GameOptions_CP",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "gameOptions"
|
||||
}
|
||||
})
|
||||
if not Engine.IsCampaignModeZombies() then
|
||||
if CoD.isSafehouse and CoD.isOnlineGame() and not IsInTrainingSim(f44_arg0) and Dvar.ui_safehousebarracks:get() and not IsPlayerAGuest(f44_arg0) then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "CPUI_BARRACKS_CAPS",
|
||||
tabWidget = "CoD.CombatRecordCP_Contents",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "combatRecord"
|
||||
}
|
||||
})
|
||||
end
|
||||
if HighestMapReachedGreaterThan(f44_arg0, 1) or LUI.DEV ~= nil then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "CPUI_TACTICAL_MODE_CAPS",
|
||||
tabWidget = "CoD.StartMenu_TacticalMode",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "tacticalMode"
|
||||
}
|
||||
})
|
||||
end
|
||||
if not CoD.isSafehouse and not IsPlayerAGuest(f44_arg0) then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "CPUI_ACCOLADES",
|
||||
tabWidget = "CoD.MissionRecordVault_Challenges",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "accolades"
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
elseif Engine.IsZombiesGame() then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = SessionModeToUnlocalizedSessionModeCaps(Engine.CurrentSessionMode()),
|
||||
tabWidget = "CoD.StartMenu_GameOptions_ZM",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "gameOptions"
|
||||
}
|
||||
})
|
||||
else
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = SessionModeToUnlocalizedSessionModeCaps(Engine.CurrentSessionMode()),
|
||||
tabWidget = "CoD.StartMenu_GameOptions",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "gameOptions"
|
||||
}
|
||||
})
|
||||
end
|
||||
else
|
||||
if not IsPlayerAGuest(f44_arg0) then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "MENU_TAB_IDENTITY_CAPS",
|
||||
tabWidget = "CoD.StartMenu_Identity",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "identity",
|
||||
disabled = Dvar.ui_execdemo_gamescom:get()
|
||||
}
|
||||
})
|
||||
end
|
||||
if not IsLobbyNetworkModeLAN() and not Dvar.ui_execdemo:get() and not Engine.IsCampaignModeZombies() and not IsPlayerAGuest(f44_arg0) then
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "MENU_TAB_CHALLENGES_CAPS",
|
||||
tabWidget = "CoD.StartMenu_Challenges",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "challenges"
|
||||
}
|
||||
})
|
||||
local f44_local1 = CoD.isPC
|
||||
if f44_local1 then
|
||||
f44_local1 = false --Mods_IsUsingMods()
|
||||
end
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "MENU_TAB_BARRACKS_CAPS",
|
||||
tabWidget = "CoD.StartMenu_Barracks",
|
||||
tabIcon = "",
|
||||
disabled = f44_local1
|
||||
},
|
||||
properties = {
|
||||
tabId = "barracks"
|
||||
}
|
||||
})
|
||||
if CommunityOptionsEnabled() then
|
||||
local f44_local2 = CoD.perController[f44_arg0].openMediaTabAfterClosingGroups
|
||||
CoD.perController[f44_arg0].openMediaTabAfterClosingGroups = false
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabName = "MENU_TAB_MEDIA_CAPS",
|
||||
tabWidget = "CoD.StartMenu_Media",
|
||||
tabIcon = ""
|
||||
},
|
||||
properties = {
|
||||
tabId = "media",
|
||||
selectIndex = f44_local2
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
if IsGameTypeDOA() and Engine.IsInGame() and not InSafehouse() then
|
||||
local f44_local1 = table.insert
|
||||
local f44_local2 = f44_local0
|
||||
local f44_local3 = {
|
||||
models = {
|
||||
tabName = "MENU_TAB_OPTIONS_CAPS",
|
||||
tabWidget = "CoD.StartMenu_Options_DOA",
|
||||
tabIcon = ""
|
||||
}
|
||||
}
|
||||
local f44_local4 = {
|
||||
tabId = "options"
|
||||
}
|
||||
local f44_local5 = Dvar.ui_execdemo:get()
|
||||
if f44_local5 then
|
||||
f44_local5 = not Engine.IsInGame()
|
||||
end
|
||||
f44_local4.selectIndex = f44_local5
|
||||
f44_local3.properties = f44_local4
|
||||
f44_local1(f44_local2, f44_local3)
|
||||
else
|
||||
local f44_local1 = table.insert
|
||||
local f44_local2 = f44_local0
|
||||
local f44_local3 = {
|
||||
models = {
|
||||
tabName = "MENU_TAB_OPTIONS_CAPS",
|
||||
tabWidget = "CoD.StartMenu_Options",
|
||||
tabIcon = ""
|
||||
}
|
||||
}
|
||||
local f44_local4 = {
|
||||
tabId = "options"
|
||||
}
|
||||
local f44_local5 = Dvar.ui_execdemo_gamescom:get()
|
||||
if f44_local5 then
|
||||
f44_local5 = not Engine.IsInGame()
|
||||
end
|
||||
f44_local4.selectIndex = f44_local5
|
||||
f44_local3.properties = f44_local4
|
||||
f44_local1(f44_local2, f44_local3)
|
||||
end
|
||||
table.insert(f44_local0, {
|
||||
models = {
|
||||
tabIcon = CoD.buttonStrings.shoulderr
|
||||
},
|
||||
properties = {
|
||||
m_mouseDisabled = true
|
||||
}
|
||||
})
|
||||
return f44_local0
|
||||
end, true)
|
@ -16,6 +16,28 @@ local SetButtonState = function(button, state)
|
||||
end
|
||||
end
|
||||
|
||||
local RemoveButton = function(buttonTable, button)
|
||||
for id, v in pairs(buttonTable) do
|
||||
if buttonTable[id].optionDisplay == button.stringRef then
|
||||
table.remove(buttonTable, id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local RemoveSpaces = function(buttonTable)
|
||||
for id, v in pairs(buttonTable) do
|
||||
buttonTable[id].isLastButtonInGroup = false
|
||||
end
|
||||
end
|
||||
|
||||
local GetButtonIndex = function(buttonTable, button)
|
||||
for id, v in pairs(buttonTable) do
|
||||
if buttonTable[id].optionDisplay == button.stringRef then
|
||||
return id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local AddButton = function(controller, options, button, isLargeButton, index)
|
||||
if button == nil then
|
||||
return
|
||||
@ -125,5 +147,8 @@ return {
|
||||
AddButton = AddButton,
|
||||
AddLargeButton = AddLargeButton,
|
||||
AddSmallButton = AddSmallButton,
|
||||
AddSpacer = AddSpacer
|
||||
AddSpacer = AddSpacer,
|
||||
RemoveButton = RemoveButton,
|
||||
RemoveSpaces = RemoveSpaces,
|
||||
GetButtonIndex = GetButtonIndex
|
||||
}
|
||||
|
34
data/ui_scripts/playlist/__init__.lua
Normal file
34
data/ui_scripts/playlist/__init__.lua
Normal file
@ -0,0 +1,34 @@
|
||||
if Engine.GetCurrentMap() ~= "core_frontend" then
|
||||
return
|
||||
end
|
||||
|
||||
if CoD.LobbyMember then
|
||||
local oldLobbyMember = CoD.LobbyMember.new
|
||||
function CoD.LobbyMember.new(menu, controller)
|
||||
local self = oldLobbyMember(menu, controller)
|
||||
|
||||
-- Hide the playlist count text
|
||||
if self.SearchingForPlayer then
|
||||
self.SearchingForPlayer:setAlpha(0)
|
||||
end
|
||||
if self.FEMemberBlurPanelContainer0 then
|
||||
self.FEMemberBlurPanelContainer0:setAlpha(0)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
end
|
||||
|
||||
function IsLobbyStatusVisible()
|
||||
return false
|
||||
end
|
||||
|
||||
Engine.SetDvar("lobbyMigrate_Enabled", 0)
|
||||
Engine.SetDvar("lobbyTimerStatusVotingInterval", 11000)
|
||||
Engine.SetDvar("lobbyTimerStatusBeginInterval", 10)
|
||||
Engine.SetDvar("lobbyTimerStatusStartInterval", 10)
|
||||
Engine.SetDvar("lobbyTimerStatusPostGameInterval", 10)
|
||||
Engine.SetDvar("lobbyTimerStatusVotingInterval_Arena", 11000)
|
||||
|
||||
require("widget_playlist_match_settings_info")
|
||||
require("widget_playlist_category_match_settings_info")
|
@ -0,0 +1,15 @@
|
||||
if not CoD.playlistCategoryMatchSettingsInfo then
|
||||
return
|
||||
end
|
||||
|
||||
local oldPlaylistCategoryMatchSettingsInfo = CoD.playlistCategoryMatchSettingsInfo.new
|
||||
function CoD.playlistCategoryMatchSettingsInfo.new(menu, controller)
|
||||
local self = oldPlaylistCategoryMatchSettingsInfo(menu, controller)
|
||||
|
||||
-- Hide the playlist count text
|
||||
if self.playlistCount then
|
||||
self.playlistCount:setAlpha(0)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
@ -0,0 +1,15 @@
|
||||
if not CoD.playlistMatchSettingsInfo then
|
||||
return
|
||||
end
|
||||
|
||||
local oldPlaylistMatchSettingsInfo = CoD.playlistMatchSettingsInfo.new
|
||||
function CoD.playlistMatchSettingsInfo.new(menu, controller)
|
||||
local self = oldPlaylistMatchSettingsInfo(menu, controller)
|
||||
|
||||
-- Hide the playlist count text
|
||||
if self.playlistCount then
|
||||
self.playlistCount:setAlpha(0)
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
Loading…
Reference in New Issue
Block a user