From 010bdb41aa16d694d4c5a6d1c4da95de5bb88bb0 Mon Sep 17 00:00:00 2001 From: WantedDV <122710241+WantedDV@users.noreply.github.com> Date: Wed, 2 Oct 2024 15:42:32 -0230 Subject: [PATCH] combat training (#299) * combat training * Disable bot & gamesetting customization menus - feature not yet available. - cleanup unused code --- data/cdata/custom_scripts/mp/bots.gsc | 81 ++++ data/cdata/start.cfg | 5 + .../ui_scripts/Conditions/InFrontend.lua | 29 ++ data/cdata/ui_scripts/Conditions/InGame.lua | 30 ++ data/cdata/ui_scripts/Conditions/__init__.lua | 11 + data/cdata/ui_scripts/EndGame/__init__.lua | 237 +++++++++ .../ui_scripts/Lobby/GameSetupButtonsBots.lua | 370 ++++++++++++++ .../ui_scripts/Lobby/GameSetupOptions.lua | 187 ++++++++ .../ui_scripts/Lobby/LobbyMissionButtons.lua | 100 ++++ data/cdata/ui_scripts/Lobby/__init__.lua | 58 +++ .../MainMenu/CPMPMainMenuButtons.lua | 110 +++++ data/cdata/ui_scripts/MainMenu/CPMainMenu.lua | 8 +- .../ui_scripts/MainMenu/CPMainMenuButtons.lua | 201 -------- .../MainMenu/CampaignMenuButtons.lua | 189 -------- data/cdata/ui_scripts/MainMenu/MPMainMenu.lua | 450 ------------------ .../ui_scripts/MainMenu/MPMainMenuButtons.lua | 208 -------- .../ui_scripts/MainMenu/MissionButtons.lua | 51 ++ .../MainMenu/MissionsVerticalLayout.lua | 160 ------- data/cdata/ui_scripts/MainMenu/__init__.lua | 9 +- src/client/resources/dw/playlists_tu23.aggr | Bin 11645 -> 11645 bytes 20 files changed, 1276 insertions(+), 1218 deletions(-) create mode 100644 data/cdata/custom_scripts/mp/bots.gsc create mode 100644 data/cdata/start.cfg create mode 100644 data/cdata/ui_scripts/Conditions/InFrontend.lua create mode 100644 data/cdata/ui_scripts/Conditions/InGame.lua create mode 100644 data/cdata/ui_scripts/Conditions/__init__.lua create mode 100644 data/cdata/ui_scripts/EndGame/__init__.lua create mode 100644 data/cdata/ui_scripts/Lobby/GameSetupButtonsBots.lua create mode 100644 data/cdata/ui_scripts/Lobby/GameSetupOptions.lua create mode 100644 data/cdata/ui_scripts/Lobby/LobbyMissionButtons.lua create mode 100644 data/cdata/ui_scripts/Lobby/__init__.lua create mode 100644 data/cdata/ui_scripts/MainMenu/CPMPMainMenuButtons.lua delete mode 100644 data/cdata/ui_scripts/MainMenu/CPMainMenuButtons.lua delete mode 100644 data/cdata/ui_scripts/MainMenu/CampaignMenuButtons.lua delete mode 100644 data/cdata/ui_scripts/MainMenu/MPMainMenu.lua delete mode 100644 data/cdata/ui_scripts/MainMenu/MPMainMenuButtons.lua create mode 100644 data/cdata/ui_scripts/MainMenu/MissionButtons.lua delete mode 100644 data/cdata/ui_scripts/MainMenu/MissionsVerticalLayout.lua diff --git a/data/cdata/custom_scripts/mp/bots.gsc b/data/cdata/custom_scripts/mp/bots.gsc new file mode 100644 index 00000000..6873916b --- /dev/null +++ b/data/cdata/custom_scripts/mp/bots.gsc @@ -0,0 +1,81 @@ +#include scripts\mp\bots\bots; +#include scripts\mp\bots\bots_util; + +main() +{ + initdvars(); + replacefunc(scripts\mp\bots\bots::init, ::init_stub); + replacefunc(scripts\mp\bots\bots_util::bot_get_client_limit, ::bot_get_client_limit); +} + +initdvars() +{ +} + +gethostplayer() +{ + var_0 = getentarray( "player", "classname" ); + + for ( var_1 = 0; var_1 < var_0.size; var_1++ ) + { + if ( var_0[var_1] ishost() ) + return var_0[var_1]; + } +} + +get_host() +{ + host = gethostplayer(); + + while (!isdefined(host)) + { + wait(0.25); + host = gethostplayer(); + } + + return host; +} + +wait_for_host() +{ + host = get_host(); + + while ( isdefined( host ) && !host.hasspawned && !isdefined( host.selectedclass ) ) + { + wait(0.25); + } + + return 1; +} + +init_stub() +{ + thread monitor_smoke_grenades(); + thread bot_triggers(); + initbotlevelvariables(); + + refresh_existing_bots(); + wait_for_host(); + + var_0 = botautoconnectenabled(); + setmatchdata( "hasBots", 1 ); + level thread bot_connect_monitor(); +} + +bot_get_client_limit() +{ + var_0 = getdvarint( "party_maxplayers", 0 ); + + maxclients = level.maxclients; + + if ( var_0 != level.maxclients && var_0 >= 1 ) + { + if ( var_0 > 18 ) + maxclients = 18; + else + maxclients = var_0; + } + + setdvar( "sv_maxclients", maxclients ); + return maxclients; +} diff --git a/data/cdata/start.cfg b/data/cdata/start.cfg new file mode 100644 index 00000000..d8850e75 --- /dev/null +++ b/data/cdata/start.cfg @@ -0,0 +1,5 @@ +party_minplayers 1 +xblive_privatematch 1 +xpartygo +xblive_privatematch 0 +wait 10 diff --git a/data/cdata/ui_scripts/Conditions/InFrontend.lua b/data/cdata/ui_scripts/Conditions/InFrontend.lua new file mode 100644 index 00000000..8facef7b --- /dev/null +++ b/data/cdata/ui_scripts/Conditions/InFrontend.lua @@ -0,0 +1,29 @@ +if not Engine.InFrontend() then + return +end + +-- GENERAL +Engine.SetDvarBool("daily_login_bonus_enabled", false) + +function CONDITIONS.IsStoreAllowed(self) + return true +end + +function CODTV.IsCODTVEnabled() + return false +end + +-- MP +if CONDITIONS.InFrontendPublicMP then + function CONDITIONS.IsServerBrowserAllowed(self) + return true + end + + function CONDITIONS.IsGameBattlesAllowed(self) + return CONDITIONS.IsServerBrowserAllowed(self) + end +end + +-- MP PRIVATE +if CONDITIONS.InFrontend and Engine.IsCoreMode() and (IsPrivateMatch() or IsSystemLink()) then +end diff --git a/data/cdata/ui_scripts/Conditions/InGame.lua b/data/cdata/ui_scripts/Conditions/InGame.lua new file mode 100644 index 00000000..79ad04ce --- /dev/null +++ b/data/cdata/ui_scripts/Conditions/InGame.lua @@ -0,0 +1,30 @@ +if Engine.InFrontend() then + return +end + +-- Multiplayer +if CONDITIONS.IsMultiplayer then + function CONDITIONS.IsTeamChoiceAllowed(self) + return IsCurrentGameTypeteamBased() + end + + function CONDITIONS.IsCODCastingAllowed(self) + return true + end + + function CONDITIONS.IsTeamOrCodcasterChoiceAllowed(self) + return CONDITIONS.IsTeamChoiceAllowed(self) or CONDITIONS.IsCODCastingAllowed(self) + end + + function Lobby.IsTeamAssignmentEnabled() + return true + end +end + +-- ZOMBIES +if CONDITIONS.IsThirdGameMode then +end + +-- Singleplayer +if CONDITIONS.IsSingleplayer then +end diff --git a/data/cdata/ui_scripts/Conditions/__init__.lua b/data/cdata/ui_scripts/Conditions/__init__.lua new file mode 100644 index 00000000..85611905 --- /dev/null +++ b/data/cdata/ui_scripts/Conditions/__init__.lua @@ -0,0 +1,11 @@ +if CONDITIONS.InFrontend then + require("InFrontend") +end + +if CONDITIONS.InGame then + require("InGame") +end + +function CheckTURequirement(f10_arg0, f10_arg1) + return false +end diff --git a/data/cdata/ui_scripts/EndGame/__init__.lua b/data/cdata/ui_scripts/EndGame/__init__.lua new file mode 100644 index 00000000..b9ba5112 --- /dev/null +++ b/data/cdata/ui_scripts/EndGame/__init__.lua @@ -0,0 +1,237 @@ +if Engine.InFrontend() then + return +end + +local RequestLeaveMenu = function(f1_arg0, f1_arg1) + LUI.FlowManager.RequestLeaveMenu(f1_arg0) +end + +local PopupMessage = function(f2_arg0, f2_arg1) + f2_arg0:setText(f2_arg1.message_text) + f2_arg0:dispatchEventToRoot({ + name = "resize_popup", + }) +end + +local Backout = function(f3_arg0) + Engine.ExecFirstClient("xpartybackout") + Engine.ExecFirstClient("disconnect") +end + +local DisbandAfterRound = function(f4_arg0) + Engine.ExecFirstClient("xpartydisbandafterround") + Engine.ExecFirstClient("disconnect") +end + +local OnlineGame = function(f5_arg0) + return Engine.GetDvarBool("onlinegame") +end + +local Quit1 = function(f6_arg0) + if OnlineGame(f6_arg0) then + Engine.ExecFirstClient("xstopprivateparty") + Engine.ExecFirstClient("disconnect") + Engine.ExecFirstClient("xblive_privatematch 0") + Engine.ExecFirstClient("onlinegame 1") + Engine.ExecFirstClient("xstartprivateparty") + else + Engine.ExecFirstClient("disconnect") + end +end + +local Quit2 = function(f7_arg0) + Engine.ExecFirstClient("xstopprivateparty") + Engine.ExecFirstClient("xpartydisbandafterround") + if Engine.GetDvarBool("sv_running") then + Engine.NotifyServer("end_game", 1) + Engine.ExecFirstClient("xblive_privatematch 0") + Engine.ExecFirstClient("onlinegame 1") + Engine.ExecFirstClient("xstartprivateparty") + else + Quit1(f7_arg0) + end +end + +local Quit3 = function(f7_arg0, f7_arg1) + if Engine.GetDvarBool("sv_running") then + if Engine.IsAliensMode() then + Engine.Unpause() + if Engine.IsAliensMode() and not IsSystemLink() then + for f7_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do + if Engine.HasActiveLocalClient(f7_local0) then + Loot.ConsumeAll(f7_local0) + end + end + end + end + Engine.NotifyServer("end_game", 1) + Engine.ExecNow("set endgame_called 1") + else + if Engine.IsAliensMode() and not IsSystemLink() then + for f7_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do + if Engine.HasActiveLocalClient(f7_local0) then + Loot.ConsumeAll(f7_local0) + end + end + end + Quit1(f7_arg0) + end + LUI.FlowManager.RequestCloseAllMenus() +end + +local LeaveWithParty = function(f8_arg0, f8_arg1) + LUI.FlowManager.RequestLeaveMenu(f8_arg0) + Engine.Exec("onPlayerQuit") + if Engine.GetDvarBool("sv_running") then + DisbandAfterRound(f8_arg0) + else + Backout(f8_arg0) + end + LUI.FlowManager.RequestCloseAllMenus() +end + +local LeaveSolo = function(f9_arg0, f9_arg1) + LUI.FlowManager.RequestLeaveMenu(f9_arg0) + Engine.Exec("onPlayerQuit") + if Engine.GetDvarBool("sv_running") then + Engine.NotifyServer("end_game", 2) + Quit2(f9_arg0) + else + Quit1(f9_arg0) + end + LUI.FlowManager.RequestCloseAllMenus() +end + +local IsPartyHost = function(f10_arg0) + local f10_local0 = Lobby.IsInPrivateParty() + if f10_local0 then + f10_local0 = Lobby.IsPrivatePartyHost() + if f10_local0 then + f10_local0 = not Lobby.IsAloneInPrivateParty() + end + end + return f10_local0 +end + +local ManualQuit = function(f11_arg0, f11_arg1) + Engine.ExecNow("uploadStats") + if Engine.IsAliensMode() and not IsSystemLink() then + for f11_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do + if Engine.HasActiveLocalClient(f11_local0) then + Loot.ConsumeAll(f11_local0) + end + end + end + if IsPartyHost(f11_arg0) then + LUI.FlowManager.RequestLeaveMenu(f11_arg0, true) + LUI.FlowManager.RequestPopupMenu(f11_arg0, "PullPartyPopup", false) + else + Engine.Exec("onPlayerQuit") + if Engine.GetDvarBool("sv_running") then + Quit2(f11_arg0) + else + Quit1(f11_arg0) + end + LUI.FlowManager.RequestCloseAllMenus() + end +end + +local EndGamePopup = function() + local self = LUI.UIElement.new() + self.id = "end_game_id" + self:registerAnimationState("default", { + topAnchor = true, + leftAnchor = true, + bottomAnchor = true, + rightAnchor = true, + top = -50, + left = 0, + bottom = 0, + right = 0, + alpha = 1, + }) + self:animateToState("default", 0) + local f12_local1 = Engine.Localize("@LUA_MENU_END_GAME_DESC") + local f12_local2 = Engine.Localize("@LUA_MENU_LEAVE_GAME_TITLE") + if Engine.IsAliensMode() and Game.GetOmnvar("zm_ui_is_solo") then + f12_local1 = Engine.Localize("@CP_ZMB_LEAVE_GAME_DESC") + f12_local2 = Engine.Localize("@MENU_NOTICE") + end + MenuBuilder.BuildAddChild(self, { + type = "generic_yesno_popup", + id = "privateGame_options_list_id", + properties = { + message_text_alignment = LUI.Alignment.Center, + message_text = f12_local1, + popup_title = f12_local2, + padding_top = 12, + yes_action = Quit3, + }, + }) + local f12_local3 = LUI.UIBindButton.new() + f12_local3.id = "endBackToGameStartButton" + f12_local3:registerEventHandler("button_start", RequestLeaveMenu) + self:addElement(f12_local3) + return self +end + +local LeaveGamePopup = function() + local self = LUI.UIElement.new() + self.id = "leave_game_id" + self:registerAnimationState("default", { + topAnchor = true, + leftAnchor = true, + bottomAnchor = true, + rightAnchor = true, + top = -50, + left = 0, + bottom = 0, + right = 0, + alpha = 1, + }) + self:animateToState("default", 0) + MenuBuilder.BuildAddChild(self, { + type = "generic_yesno_popup", + id = "publicGame_options_list_id", + properties = { + message_text_alignment = LUI.Alignment.Center, + message_text = Engine.IsAliensMode() and Engine.Localize("@CP_ZMB_LEAVE_GAME_DESC") + or Engine.Localize("@LUA_MENU_LEAVE_GAME_DESC"), + popup_title = Engine.IsAliensMode() and Engine.Localize("@MENU_NOTICE") + or Engine.Localize("@LUA_MENU_LEAVE_GAME_TITLE"), + padding_top = 12, + yes_action = ManualQuit, + }, + }) + local f13_local1 = LUI.UIBindButton.new() + f13_local1.id = "leaveBackToGameStartButton" + f13_local1:registerEventHandler("button_start", RequestLeaveMenu) + self:addElement(f13_local1) + return self +end + +local PullPartyPopup = function(f14_arg0, f14_arg1) + local f14_local0 = MenuBuilder.BuildRegisteredType("PopupMessageAndButtons", { + title = Engine.Localize("LUA_MENU_LEAVE_GAME_TITLE"), + message = Engine.Localize("LUA_MENU_PULL_PARTY_DESC"), + defaultFocusIndex = 2, + cancelClosesPopup = true, + buttonsClosePopup = true, + buttons = { + { + label = Engine.Localize("LUA_MENU_YES"), + action = LeaveWithParty, + }, + { + label = Engine.Localize("LUA_MENU_NO"), + action = LeaveSolo, + }, + }, + }) + f14_local0.id = "PullPartyPopup" + return f14_local0 +end + +MenuBuilder.m_types["popup_end_game"] = EndGamePopup +MenuBuilder.m_types["popup_leave_game"] = LeaveGamePopup +MenuBuilder.m_types["PullPartyPopup"] = PullPartyPopup diff --git a/data/cdata/ui_scripts/Lobby/GameSetupButtonsBots.lua b/data/cdata/ui_scripts/Lobby/GameSetupButtonsBots.lua new file mode 100644 index 00000000..ea41fc1e --- /dev/null +++ b/data/cdata/ui_scripts/Lobby/GameSetupButtonsBots.lua @@ -0,0 +1,370 @@ +local Bot = {} +Bot.BotTeams = { + Friendly = 0, + Enemy = 1, + FFA = 2, +} +Bot.BotLimit = 17 +Bot.BotDifficulties = { + Recruit = 0, + Regular = 1, + Hardened = 2, + Veteran = 3, + Mixed = 4, +} + +Bot.GetMaxBotLimit = function() + return 17 +end + +Bot.GetBotsTeamLimit = function(team) + local botcount = 0 + if team == Bot.BotTeams.Friendly then + botcount = Engine.GetDvarInt("bot_allies") + elseif team == Bot.BotTeams.Enemy then + botcount = Engine.GetDvarInt("bot_enemies") + else + botcount = Engine.GetDvarInt("bot_free") + end + if tonumber(botcount) <= 0 then + botcount = 0 + end + return tonumber(botcount) +end + +Bot.SetBotsDifficulty = function(team, difficulty) + if team == Bot.BotTeams.Friendly then + Engine.Exec("set bot_difficulty_allies " .. tostring(difficulty)) + elseif team == Bot.BotTeams.Enemy then + Engine.Exec("set bot_difficulty_enemies " .. tostring(difficulty)) + else + Engine.Exec("set bot_difficulty_free " .. tostring(difficulty)) + end +end + +Bot.GetBotsDifficulty = function(team) + local difficulty = 4 + if team == Bot.BotTeams.Friendly then + difficulty = Engine.GetDvarInt("bot_difficulty_allies") + elseif team == Bot.BotTeams.Enemy then + difficulty = Engine.GetDvarInt("bot_difficulty_enemies") + else + difficulty = Engine.GetDvarInt("bot_difficulty_free") + end + if not difficulty then + difficulty = 4 + end + return tonumber(difficulty) +end + +Bot.SetBotsTeamLimit = function(team, size) + Lobby.SetBotsTeamLimit(team, size) + if team == Bot.BotTeams.Friendly then + Engine.Exec("set bot_allies " .. tostring(size)) + elseif team == Bot.BotTeams.Enemy then + Engine.Exec("set bot_enemies " .. tostring(size)) + else + Engine.Exec("set bot_free " .. tostring(size)) + end +end + +local update_button = function(f1_arg0, f1_arg1, f1_arg2) + f1_arg0.currentValue = f1_arg1 + f1_arg0:UpdateContent() + if f1_arg0.autoFunctionCall then + f1_arg0.action(f1_arg0.currentValue, f1_arg2) + end +end + +local f0_local0 = function(f1_arg0, f1_arg1, f1_arg2) + local f1_local0 = { + [Bot.BotTeams.FFA] = f1_arg0.FFABots, + [Bot.BotTeams.Enemy] = f1_arg0.EnemyBots, + [Bot.BotTeams.Friendly] = f1_arg0.FriendlyBots, + } + local f1_local1 = function(team, teambased) + local f2_local0 = {} + local MaxBotLimit = Bot.GetMaxBotLimit() + for f2_local2 = 0, MaxBotLimit, 1 do + table.insert(f2_local0, tostring(f2_local2)) + end + local f2_local2 = 1 + Bot.GetBotsTeamLimit(team) + if #f2_local0 < f2_local2 then + Bot.SetBotsTeamLimit(team, #f2_local0 - 1) + f2_local2 = #f2_local0 + end + if not teambased then + local MaxBotLimit = Bot.GetMaxBotLimit() + if MaxBotLimit < f2_local2 then + f2_local2 = MaxBotLimit + 1 + end + end + return { + labels = f2_local0, + action = function(f3_arg0) + Bot.SetBotsTeamLimit(team, f3_arg0 - 1) + if teambased and (Bot.GetBotsTeamLimit(0) + Bot.GetBotsTeamLimit(1)) >= Bot.GetMaxBotLimit() then + local adjustteam = 0 + local otherside = 1 + if team == Bot.BotTeams.Friendly then + adjustteam = Bot.BotTeams.Enemy + otherside = 0 + end + if team == Bot.BotTeams.Enemy then + adjustteam = Bot.BotTeams.Friendly + otherside = 1 + end + local adjustval = Bot.GetMaxBotLimit() - Bot.GetBotsTeamLimit(otherside) + if adjustval <= 0 then + adjustval = 1 + end + f1_local0[adjustteam].currentValue = adjustval + + f1_local0[adjustteam]:UpdateContent() + Bot.SetBotsTeamLimit(adjustteam, adjustval - 1) + end + end, + defaultValue = f2_local2, + wrapAround = false, + } + end + + local f1_local2 = function(f4_arg0) + local f4_local0 = {} + table.insert(f4_local0, Engine.Localize("LUA_MENU_BOTS_RECRUIT")) + table.insert(f4_local0, Engine.Localize("LUA_MENU_BOTS_REGULAR")) + table.insert(f4_local0, Engine.Localize("LUA_MENU_BOTS_HARDENED")) + table.insert(f4_local0, Engine.Localize("LUA_MENU_BOTS_VETERAN")) + table.insert(f4_local0, Engine.Localize("LUA_MENU_BOTS_MIXED")) + return { + labels = f4_local0, + action = function(f5_arg0) + Bot.SetBotsDifficulty(f4_arg0, f5_arg0 - 1) + end, + defaultValue = 1 + Bot.GetBotsDifficulty(f4_arg0), + wrapAround = true, + } + end + + if + f1_arg0.FriendlyBots + and f1_arg0.FriendlyBotsDifficulty + and f1_arg0.EnemyBots + and f1_arg0.EnemyBotsDifficulty + then + LUI.AddUIArrowTextButtonLogic( + f1_arg0.FriendlyBots, + f1_arg1, + f1_local1(Bot.BotTeams.Friendly, Bot.BotTeams.Enemy) + ) + LUI.AddUIArrowTextButtonLogic(f1_arg0.EnemyBots, f1_arg1, f1_local1(Bot.BotTeams.Enemy, Bot.BotTeams.Friendly)) + LUI.AddUIArrowTextButtonLogic(f1_arg0.FriendlyBotsDifficulty, f1_arg1, f1_local2(Bot.BotTeams.Friendly)) + LUI.AddUIArrowTextButtonLogic(f1_arg0.EnemyBotsDifficulty, f1_arg1, f1_local2(Bot.BotTeams.Enemy)) + end + if f1_arg0.FFABots and f1_arg0.FFABotsDifficulty then + LUI.AddUIArrowTextButtonLogic(f1_arg0.FFABots, f1_arg1, f1_local1(Bot.BotTeams.FFA)) + LUI.AddUIArrowTextButtonLogic(f1_arg0.FFABotsDifficulty, f1_arg1, f1_local2(Bot.BotTeams.FFA)) + end + local f1_local3 = LUI.DataSourceInGlobalModel.new("frontEnd.Bot.areWeGameHost") + f1_arg0:SubscribeToModel(f1_local3:GetModel(f1_arg1), function(f6_arg0) + local f6_local0 = DataModel.GetModelValue(f6_arg0) + local f6_local1 = IsSystemLink() + if f1_arg0.FriendlyBots and f1_arg0.FriendlyBotsDifficulty then + local f6_local2 = f1_arg0.FriendlyBots + local f6_local3 = f6_local2 + f6_local2 = f6_local2.SetButtonDisabled + local f6_local4 + if not f6_local0 then + f6_local4 = not f6_local1 + else + f6_local4 = false + end + f6_local2(f6_local3, false) + f6_local2 = f1_arg0.FriendlyBotsDifficulty + f6_local3 = f6_local2 + f6_local2 = f6_local2.SetButtonDisabled + if not f6_local0 then + f6_local4 = not f6_local1 + else + f6_local4 = false + end + f6_local2(f6_local3, false) + end + if f1_arg0.EnemyBots and f1_arg0.EnemyBotsDifficulty then + local f6_local2 = f1_arg0.EnemyBots + local f6_local3 = f6_local2 + f6_local2 = f6_local2.SetButtonDisabled + local f6_local4 + if not f6_local0 then + f6_local4 = not f6_local1 + else + f6_local4 = false + end + f6_local2(f6_local3, false) + f6_local2 = f1_arg0.EnemyBotsDifficulty + f6_local3 = f6_local2 + f6_local2 = f6_local2.SetButtonDisabled + if not f6_local0 then + f6_local4 = not f6_local1 + else + f6_local4 = false + end + f6_local2(f6_local3, false) + end + if f1_arg0.FFABots and f1_arg0.FFABotsDifficulty then + local f6_local2 = f1_arg0.FFABots + local f6_local3 = f6_local2 + f6_local2 = f6_local2.SetButtonDisabled + local f6_local4 + if not f6_local0 then + f6_local4 = not f6_local1 + else + f6_local4 = false + end + f6_local2(f6_local3, false) + f6_local2 = f1_arg0.FFABotsDifficulty + f6_local3 = f6_local2 + f6_local2 = f6_local2.SetButtonDisabled + if not f6_local0 then + f6_local4 = not f6_local1 + else + f6_local4 = false + end + f6_local2(f6_local3, false) + end + end) +end + +local GameSetupButtonsBotsCombatTraining = function(menu, controller) + local self = LUI.UIVerticalList.new() + self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 600 * _1080p, 0, 280 * _1080p) + self.id = "GameSetupButtonsBotsCombatTraining" + local f7_local1 = controller and controller.controllerIndex + if not f7_local1 and not Engine.InFrontend() then + f7_local1 = self:getRootController() + end + assert(f7_local1) + self:SetSpacing(10 * _1080p) + local f7_local3 = nil + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local3 = MenuBuilder.BuildRegisteredType("GenericArrowButton", { + controllerIndex = f7_local1, + }) + f7_local3.id = "FriendlyBots" + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local3.buttonDescription = Engine.Localize("LUA_MENU_FRIENDLY_BOTS_DESC") + end + f7_local3.Title:setText(ToUpperCase(Engine.Localize("LUA_MENU_FRIENDLY_BOTS_CAPS")), 0) + f7_local3.Text:setText(ToUpperCase(""), 0) + f7_local3:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, 0, _1080p * 30) + self:addElement(f7_local3) + self.FriendlyBots = f7_local3 + end + local f7_local4 = nil + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local4 = MenuBuilder.BuildRegisteredType("GenericArrowButton", { + controllerIndex = f7_local1, + }) + f7_local4.id = "FriendlyBotsDifficulty" + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local4.buttonDescription = Engine.Localize("LUA_MENU_FRIENDLY_BOTDIFFICULTY_DESC") + end + f7_local4.Title:setText(ToUpperCase(Engine.Localize("LUA_MENU_BOTDIFFICULTY_CAPS")), 0) + f7_local4.Text:setText(ToUpperCase(""), 0) + f7_local4:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 40, _1080p * 70) + self:addElement(f7_local4) + self.FriendlyBotsDifficulty = f7_local4 + end + local f7_local5 = nil + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local5 = LUI.UIImage.new() + f7_local5.id = "SpacerImage" + f7_local5:SetAlpha(0, 0) + f7_local5:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 80, _1080p * 90) + self:addElement(f7_local5) + self.SpacerImage = f7_local5 + end + local f7_local6 = nil + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local6 = MenuBuilder.BuildRegisteredType("GenericArrowButton", { + controllerIndex = f7_local1, + }) + f7_local6.id = "EnemyBots" + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local6.buttonDescription = Engine.Localize("LUA_MENU_ENEMY_BOTS_DESC") + end + f7_local6.Title:setText(ToUpperCase(Engine.Localize("LUA_MENU_ENEMY_BOTS_CAPS")), 0) + f7_local6.Text:setText(ToUpperCase(""), 0) + f7_local6:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 100, _1080p * 130) + self:addElement(f7_local6) + self.EnemyBots = f7_local6 + end + local f7_local7 = nil + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local7 = MenuBuilder.BuildRegisteredType("GenericArrowButton", { + controllerIndex = f7_local1, + }) + f7_local7.id = "EnemyBotsDifficulty" + if CONDITIONS.IsTeamBasedGameType(self) then + f7_local7.buttonDescription = Engine.Localize("LUA_MENU_ENEMY_BOTDIFFICULTY_DESC") + end + f7_local7.Title:setText(ToUpperCase(Engine.Localize("LUA_MENU_BOTDIFFICULTY_CAPS")), 0) + f7_local7.Text:setText(ToUpperCase(""), 0) + f7_local7:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 140, _1080p * 170) + self:addElement(f7_local7) + self.EnemyBotsDifficulty = f7_local7 + end + local f7_local8 = nil + if not CONDITIONS.IsTeamBasedGameType(self) then + f7_local8 = MenuBuilder.BuildRegisteredType("GenericArrowButton", { + controllerIndex = f7_local1, + }) + f7_local8.id = "FFABots" + if not CONDITIONS.IsTeamBasedGameType(self) then + f7_local8.buttonDescription = Engine.Localize("LUA_MENU_BOTS_DESC") + end + f7_local8.Title:setText(ToUpperCase(Engine.Localize("LUA_MENU_BOTS_CAPS")), 0) + f7_local8.Text:setText(ToUpperCase(""), 0) + f7_local8:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 180, _1080p * 210) + self:addElement(f7_local8) + self.FFABots = f7_local8 + end + local f7_local9 = nil + if not CONDITIONS.IsTeamBasedGameType(self) then + f7_local9 = MenuBuilder.BuildRegisteredType("GenericArrowButton", { + controllerIndex = f7_local1, + }) + f7_local9.id = "FFABotsDifficulty" + if not CONDITIONS.IsTeamBasedGameType(self) then + f7_local9.buttonDescription = Engine.Localize("LUA_MENU_BOTDIFFICULTY_DESC") + end + f7_local9.Title:setText(ToUpperCase(Engine.Localize("LUA_MENU_BOTDIFFICULTY_CAPS")), 0) + f7_local9.Text:setText(ToUpperCase(""), 0) + f7_local9:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 220, _1080p * 250) + self:addElement(f7_local9) + self.FFABotsDifficulty = f7_local9 + end + local ButtonDescriptionText = nil + + ButtonDescriptionText = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", { + controllerIndex = f7_local1, + }) + ButtonDescriptionText.id = "ButtonDescriptionText" + ButtonDescriptionText:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 420, _1080p * 260, _1080p * 292) + self:addElement(ButtonDescriptionText) + self.ButtonDescriptionText = ButtonDescriptionText + + f0_local0(self, f7_local1, controller) + return self +end + +local GameSetupButtonsBotsCustomGames = package.loaded["frontEnd.mp.GameSetupButtonsBots"].GameSetupButtonsBots +GameSetupButtonsBotsOverride = function(menu, controller) + if CONDITIONS.InFrontendPublicMP then + return GameSetupButtonsBotsCombatTraining(menu, controller) + else + return GameSetupButtonsBotsCustomGames(menu, controller) + end +end + +MenuBuilder.registerType("GameSetupButtonsBots", GameSetupButtonsBotsOverride) diff --git a/data/cdata/ui_scripts/Lobby/GameSetupOptions.lua b/data/cdata/ui_scripts/Lobby/GameSetupOptions.lua new file mode 100644 index 00000000..bbf2889b --- /dev/null +++ b/data/cdata/ui_scripts/Lobby/GameSetupOptions.lua @@ -0,0 +1,187 @@ +if not Engine.InFrontend() then + return +end + +local MenuOverride = function(oldmenu, postLoad) + local newmenu = function(menu, controller) + local RootController = controller and controller.controllerIndex + if not RootController and not Engine.InFrontend() then + RootController = self:getRootController() + end + assert(RootController) + + local self = oldmenu(menu, controller) + postLoad(self) + return self + end + return newmenu +end + +local postLoadGameSetupButtonsSubMenu = function(self, f2_arg1, f2_arg2) + assert(self.MapsButton) + assert(self.MapsButton.DynamicText) + assert(self.OptionsButton) + assert(self.OptionsButton.DynamicText) + assert(self.BotSetup) + + self.MapsButton.DynamicText:setText(ToUpperCase(Lobby.GetMapName())) + self.OptionsButton:SetButtonDisabled(1) -- TODO: game settings are not applied and get rest on menu change. + self.BotSetup:SetButtonDisabled(1) -- TODO: support custom bot management (gsc + engine changes required) +end + +local GameSetupButtonsSubMenu = function(menu, controller) + local self = LUI.UIVerticalList.new() + self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 600 * _1080p, 0, 190 * _1080p) + self.id = "GameSetupButtonsSubMenu" + local rootController = controller and controller.controllerIndex + if not rootController and not Engine.InFrontend() then + rootController = self:getRootController() + end + assert(rootController) + local f3_local2 = self + self:SetSpacing(10 * _1080p) + + local MapsButton = MenuBuilder.BuildRegisteredType("GenericDualLabelButton", { + controllerIndex = rootController, + }) + MapsButton.id = "MapsButton" + MapsButton.buttonDescription = Engine.Localize("LUA_MENU_DESC_MAP") + MapsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MAP_CAPS")), 0) + MapsButton.DynamicText:setText("", 0) + MapsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, 0, _1080p * 30) + self:addElement(MapsButton) + self.MapsButton = MapsButton + + local OptionsButton = MenuBuilder.BuildRegisteredType("GenericDualLabelButton", { + controllerIndex = rootController, + }) + OptionsButton.id = "OptionsButton" + OptionsButton.buttonDescription = Engine.Localize("LUA_MENU_DESC_OPTIONS") + OptionsButton.Text:setText(ToUpperCase(Engine.Localize("MENU_CHANGE_GAME_RULES_CAPS")), 0) + OptionsButton.DynamicText:setText("", 0) + OptionsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 80, _1080p * 110) + self:addElement(OptionsButton) + self.OptionsButton = OptionsButton + + local BotSetup = MenuBuilder.BuildRegisteredType("GenericButton", { + controllerIndex = rootController, + }) + BotSetup.id = "BotSetup" + BotSetup.buttonDescription = Engine.Localize("LUA_MENU_DESC_BOTS") + BotSetup.Text:setText(Engine.Localize("LUA_MENU_BOT_SETUP_CAPS"), 0) + BotSetup:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 120, _1080p * 150) + self:addElement(BotSetup) + self.BotSetup = BotSetup + + local ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", { + controllerIndex = rootController, + }) + ButtonDescription.id = "ButtonDescription" + ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, _1080p * 160, _1080p * 200) + self:addElement(ButtonDescription) + self.ButtonDescription = ButtonDescription + + MapsButton:addEventHandler("button_action", function(f4_arg0, f4_arg1) + ACTIONS.OpenMenu("Maps", true, f4_arg1.controller or rootController) + end) + OptionsButton:addEventHandler("button_action", function(f6_arg0, f6_arg1) + ACTIONS.OpenMenu("GameSetupOptionsMenu", true, f6_arg1.controller or rootController) + end) + BotSetup:addEventHandler("button_action", function(f7_arg0, f7_arg1) + ACTIONS.OpenMenu("GameSetupBots", true, f7_arg1.controller or rootController) + end) + postLoadGameSetupButtonsSubMenu(self, rootController, controller) + return self +end + +MenuBuilder.m_types["GameSetupButtonsSubMenu"] = GameSetupButtonsSubMenu + +local f0_local0 = function(f1_arg0, f1_arg1) + f1_arg0.MenuTitle.MenuBreadcrumbs:setText(LocalizeString("COMBAT TRAINING"), 0) +end + +local CombatTrainingGameSetup = function(menu, controller) + local self = LUI.UIVerticalNavigator.new() + self.id = "CombatTrainingGameSetup" + local rootController = controller and controller.controllerIndex + if not rootController and not Engine.InFrontend() then + rootController = self:getRootController() + end + assert(rootController) + self:playSound("menu_open") + local f2_local2 = self + local ButtonHelperBar = nil + + ButtonHelperBar = MenuBuilder.BuildRegisteredType("ButtonHelperBar", { + controllerIndex = rootController, + }) + ButtonHelperBar.id = "ButtonHelperBar" + ButtonHelperBar:SetAnchorsAndPosition(0, 0, 1, 0, 0, 0, _1080p * -85, 0) + self:addElement(ButtonHelperBar) + self.ButtonHelperBar = ButtonHelperBar + + local MenuTitle = MenuBuilder.BuildRegisteredType("MenuTitle", { + controllerIndex = rootController, + }) + MenuTitle.id = "MenuTitle" + MenuTitle.MenuTitle:setText(ToUpperCase(Engine.Localize("LUA_MENU_GAME_SETUP_CAPS")), 0) + MenuTitle.MenuBreadcrumbs:setText(ToUpperCase(Engine.Localize("EXE_LOCAL_PLAY")), 0) + MenuTitle.Icon:SetTop(_1080p * -28.5, 0) + MenuTitle.Icon:SetBottom(_1080p * 61.5, 0) + MenuTitle:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 96, _1080p * 1056, _1080p * 54, _1080p * 134) + self:addElement(MenuTitle) + self.MenuTitle = MenuTitle + + local GameSetupButtons = MenuBuilder.BuildRegisteredType("GameSetupButtonsSubMenu", { + controllerIndex = rootController, + }) + GameSetupButtons.id = "GameSetupButtonsSubMenu" + GameSetupButtons:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 130, _1080p * 630, _1080p * 216, _1080p * 406) + self:addElement(GameSetupButtons) + self.GameSetupButtons = GameSetupButtons + + self.addButtonHelperFunction = function(self, f3_arg1) + self:AddButtonHelperText({ + helper_text = Engine.Localize("MENU_BACK"), + button_ref = "button_secondary", + side = "left", + priority = 10, + clickable = true, + }) + self:AddButtonHelperText({ + helper_text = Engine.Localize("LUA_MENU_SELECT"), + button_ref = "button_primary", + side = "left", + priority = -10, + clickable = true, + }) + end + + self:addEventHandler("menu_create", self.addButtonHelperFunction) + + local bindButton = LUI.UIBindButton.new() + bindButton.id = "selfBindButton" + self:addElement(bindButton) + self.bindButton = bindButton + + self.bindButton:addEventHandler("button_secondary", function(f4_arg0, f4_arg1) + local f4_local0 = f4_arg1.controller or rootController + ACTIONS.LeaveMenu(self) + end) + f0_local0(self, rootController, controller) + return self +end + +-- don't do local play things in public lobby +local SetupPrivateMatchLobbyScene_original = Lobby.SetupPrivateMatchLobbyScene +local SetupPrivateMatchLobbyScene_stub = function(a1) + if CONDITIONS.InFrontendPublicMP then + LUI.FlowManager.RegisterStackPopBehaviour("Maps", function() end) + LUI.FlowManager.RegisterStackPopBehaviour("GameSetupOptionsMenu", function() end) + else + SetupPrivateMatchLobbyScene_original(a1) + end +end +Lobby.SetupPrivateMatchLobbyScene = SetupPrivateMatchLobbyScene_stub + +MenuBuilder.registerType("CombatTrainingGameSetup", CombatTrainingGameSetup) diff --git a/data/cdata/ui_scripts/Lobby/LobbyMissionButtons.lua b/data/cdata/ui_scripts/Lobby/LobbyMissionButtons.lua new file mode 100644 index 00000000..8761bdfd --- /dev/null +++ b/data/cdata/ui_scripts/Lobby/LobbyMissionButtons.lua @@ -0,0 +1,100 @@ +function CONDITIONS.IsMatchSimToolEnabled(self) + return false +end + +local set_matchmaking_dvars = function() + Engine.Exec("xstopprivateparty") + Engine.Exec("online_matchmaking_dedi_required 0") + Engine.Exec("online_matchmaking_disband_on_update_failure 1") + Engine.Exec("online_matchmaking_no_dedi_search 1") + Engine.Exec("online_matchmaking_use_pruning 0") + Engine.Exec("online_matchmaking_start_when_dw_is_ready 1") + Engine.Exec("online_matchmaking_turn_on_broken_beta 0") + Engine.Exec("online_matchmaking_allow_lobby_merging 0") + Engine.Exec("online_matchmaking_updatehostdocs_check 0") + Engine.Exec("online_matchmaking_do_not_use_dlc_mming 1") + Engine.Exec("online_acquire_ds_during_intermission 0") + Engine.Exec("pt_maxSearchTier 0") + Engine.Exec("pt_searchConnectAttempts 0") + Engine.Exec("mming_minplayers_to_lobby 1") + Engine.Exec("scr_default_maxagents 24") + Engine.Exec("pt_migrateBeforeAdvertise 0") + Engine.Exec("party_minplayers 3") +end + +local MatchSimulator = {} +MatchSimulator.ShowGameOverScreen = function() + Engine.Exec("party_minplayers 1") + LUI.UIRoot.BlockButtonInput(Engine.GetLuiRoot(), false, "TransitionToGame") + Engine.Exec("exec start") -- TODO: figure out how to start public match correctly. This is terrible. +end + +local LobbyMissionButtons = function(menu, controller) + local self = LUI.UIVerticalNavigator.new() + self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 600 * _1080p, 0, 643 * _1080p) + self.id = "LobbyMissionButtons" + local f2_local1 = controller and controller.controllerIndex + if not f2_local1 and not Engine.InFrontend() then + f2_local1 = self:getRootController() + end + assert(f2_local1) + + local LobbyMissionVerticalLayout = MenuBuilder.BuildRegisteredType("LobbyMissionVerticalLayout", { + controllerIndex = f2_local1, + }) + LobbyMissionVerticalLayout.id = "LobbyMissionVerticalLayout" + LobbyMissionVerticalLayout:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 600, 0, _1080p * 564) + self:addElement(LobbyMissionVerticalLayout) + self.LobbyMissionVerticalLayout = LobbyMissionVerticalLayout + + local StartButton = MenuBuilder.BuildRegisteredType("GenericButton", { + controllerIndex = f6_local1, + }) + StartButton.id = "StartButton" + StartButton.Text:setText(ToUpperCase(Engine.Localize("MENU_START_MATCH")), 0) + StartButton.buttonDescription = Engine.Localize("MENU_START_MATCH") + StartButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70) + LUI.UIElement.addElementBefore(StartButton, LobbyMissionVerticalLayout:getChildById("CAC")) + LobbyMissionVerticalLayout.StartButton = StartButton + StartButton:addEventHandler("button_action", function(f14_arg0, f14_arg1) + LUI.UIRoot.BlockButtonInput(Engine.GetLuiRoot(), false, "TransitionToGame") + Engine.Exec("party_minplayers 1") + Engine.Exec("exec start") + end) + + local GameSetupButton = MenuBuilder.BuildRegisteredType("GenericButton", { + controllerIndex = f6_local1, + }) + GameSetupButton.id = "GameSetupButton" + GameSetupButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_GAME_SETUP_CAPS")), 0) + GameSetupButton.buttonDescription = Engine.Localize("LUA_MENU_DESC_GAME_SETUP") + GameSetupButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70) + LUI.UIElement.addElementBefore(GameSetupButton, LobbyMissionVerticalLayout:getChildById("CAC")) + LobbyMissionVerticalLayout.GameSetupButton = GameSetupButton + GameSetupButton:addEventHandler("button_action", function(f14_arg0, f14_arg1) + LUI.FlowManager.RequestAddMenu("CombatTrainingGameSetup", true, f14_arg1.controller, false, { + isSoloMode = false, + }) + end) + + set_matchmaking_dvars() + + local CRMMain = MenuBuilder.BuildRegisteredType("CRMMain", { + controllerIndex = f2_local1, + }) + CRMMain.id = "CRMMain" + CRMMain:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 6, _1080p * 317, _1080p * 529, _1080p * 723) + self:addElement(CRMMain) + self.CRMMain = CRMMain + + if CONDITIONS.AreContractsEnabled(self) then + ACTIONS.AnimateSequenceByElement(self, { + elementName = "CRMMain", + sequenceName = "Minimize", + elementPath = "CRMMain", + }) + end + return self +end + +MenuBuilder.m_types["LobbyMissionButtons"] = LobbyMissionButtons diff --git a/data/cdata/ui_scripts/Lobby/__init__.lua b/data/cdata/ui_scripts/Lobby/__init__.lua new file mode 100644 index 00000000..e4a3367d --- /dev/null +++ b/data/cdata/ui_scripts/Lobby/__init__.lua @@ -0,0 +1,58 @@ +if Engine.GetDvarInt("bot_init") ~= 1 then + Engine.Exec("set bot_init 1") + Engine.Exec("set bot_allies 1") + Engine.Exec("set bot_enemies 1") + Engine.Exec("set bot_free 1") + Engine.Exec("set bot_difficulty_allies 1") + Engine.Exec("set bot_difficulty_enemies 1") + Engine.Exec("set bot_difficulty_free 1") +end + +function GetMaxBotLimit() + return 17 +end + +if not Engine.InFrontend() then + return +end + +Lobby.ShouldDisplayMap = function(f37_arg0, f37_arg1) + if not (Engine.IsAliensMode() == Lobby.GetMapSupportsAliensByIdx(f37_arg0)) then + return false + else + local ID = Lobby.GetMapPackForMapIndex(f37_arg0) + if ID == Lobby.DLC1_MAP_PACK_INDEX and Engine.GetDvarBool("killswitch_dlc1_maps") then + return false + elseif ID == Lobby.DLC2_MAP_PACK_INDEX and not Engine.GetDvarBool("dlc2_maps_enabled") then + return false + elseif ID == Lobby.DLC3_MAP_PACK_INDEX and not Engine.GetDvarBool("dlc3_maps_enabled") then + return false + elseif ID == Lobby.DLC4_MAP_PACK_INDEX and not Engine.GetDvarBool("dlc4_maps_enabled") then + return false + else + local map = Lobby.GetMapLoadNameByIndex(f37_arg0) + if Engine.GetDvarBool("lui_checkIfLevelInFileSystem") and not Engine.IsLevelInFileSystem(map) then + return false + elseif not Engine.IsMapPackOwned(ID) then + return false + elseif + map == "mp_dome_dusk" + or map == "mp_permafrost2" + or map == "mp_carnage2" + or map == "mp_renaissance2" + then + return true + elseif map == "mp_skyway" then + return true + elseif map == "mp_turista2" and not Engine.GetDvarBool("mp_turista2_enabled") then + return false + else + return true + end + end + end +end + +require("LobbyMissionButtons") +require("GameSetupOptions") +require("GameSetupButtonsBots") diff --git a/data/cdata/ui_scripts/MainMenu/CPMPMainMenuButtons.lua b/data/cdata/ui_scripts/MainMenu/CPMPMainMenuButtons.lua new file mode 100644 index 00000000..3f94bc49 --- /dev/null +++ b/data/cdata/ui_scripts/MainMenu/CPMPMainMenuButtons.lua @@ -0,0 +1,110 @@ +if not Engine.InFrontend() then + return +end + +local MenuOverride = function(oldmenu, postLoad) + local newmenu = function(menu, controller) + local RootController = controller and controller.controllerIndex + if not RootController and not Engine.InFrontend() then + RootController = self:getRootController() + end + assert(RootController) + + local self = oldmenu(menu, controller) + postLoad(self) + return self + end + return newmenu +end + +local GetAnchorsAndPosition = function(element) + local l_left, l_top, l_right, l_bottom = element:getLocalRect() + local a_left, a_top, a_right, a_bottom = element:GetAnchorData() + return { a_left, a_right, a_top, a_bottom, l_left, l_right, l_bottom, l_top } +end + +local customServerButton = function(self, override, preLoad) + if not CONDITIONS.IsServerBrowserAllowed(self) then + return + end + + self.ServerBrowserButton = override + assert(self.ServerBrowserButton) + + self.ServerBrowserButton:registerEventHandler("button_action", function(f5_arg0, f5_arg1) + preLoad() + LUI.FlowManager.RequestAddMenu("SystemLinkMenu", false, f5_arg1.controller, false, {}, true) + end) + + if self.ServerBrowserButton then + self.ServerBrowserButton.id = "ServerBrowser" + self.ServerBrowserButton.buttonDescription = Engine.Localize("Browse custom servers") + self.ServerBrowserButton.Text:setText(ToUpperCase(Engine.Localize("Server Browser")), 0) + end +end + +local customModsButton = function(self, info) + if not CONDITIONS.IsServerBrowserAllowed(self) then + return + end + + if not (type(info.position) == "table" and #info.position == 8) then + return + end + + local ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", { controllerIndex = controllerIndex }) + ModsButton.id = "ModsButton" + ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC") + ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0) + if CONDITIONS.InFrontendPublicMP and CONDITIONS.IsStoreAllowed() then + self:removeElement(self.StoreButton) + end + ModsButton:SetAnchorsAndPosition(table.unpack(info.position)) + + ModsButton:registerEventHandler("button_action", function(f5_arg0, f5_arg1) + if info.preLoad then + info.preLoad() + end + LUI.FlowManager.RequestAddMenu("ModSelectMenu", false, f5_arg1.controller, false, {}, true) + end) + + ModsButton:SetAlignment(LUI.Alignment.Left) + self:addElement(ModsButton) + self.ModsButton = ModsButton +end + +local postLoadMP = function(self) + local preLoadMP = function() + local ActiveController = Engine.GetFirstActiveController() + if Engine.GetDvarBool("xblive_competitionmatch") then + Engine.SetDvarBool("xblive_competitionmatch", false) + Engine.Exec("set remove_mlg_rules 1") + end + Engine.ExecNow(MPConfig.default_xboxlive, ActiveController) + end + + local modButtonInfo = {} + modButtonInfo.preLoad = function() end + modButtonInfo.position = { 0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * (120 + 30) } + customModsButton(self, modButtonInfo) + customServerButton(self, self.MLGGameBattlesButton, preLoadMP) +end + +local postLoadCP = function(self) + local preLoadCP = function() + local ActiveController = Engine.GetFirstActiveController() + Engine.ExecNow(MPConfig.default_xboxlive, ActiveController) + end + + local modButtonInfo = {} + modButtonInfo.preLoad = function() end + modButtonInfo.position = { 0, 1, 0, 1, 0, _1080p * 500, _1080p * 300, _1080p * (300 + 30) } + customModsButton(self, modButtonInfo) + customServerButton(self, self:getChildById("PublicMatch"), preLoadCP) +end + +local MPMainMenuButtons = MenuOverride(package.loaded["frontEnd.mp.MPMainMenuButtons"].MPMainMenuButtons, postLoadMP) +local CPMainMenuButtons = MenuOverride(package.loaded["frontEnd.cp.CPMainMenuButtons"].CPMainMenuButtons, postLoadCP) + +MenuBuilder.registerType("MPMainMenuButtons", MPMainMenuButtons) +MenuBuilder.registerType("CPMainMenuButtons", CPMainMenuButtons) diff --git a/data/cdata/ui_scripts/MainMenu/CPMainMenu.lua b/data/cdata/ui_scripts/MainMenu/CPMainMenu.lua index 65b9dcc4..27b4578d 100644 --- a/data/cdata/ui_scripts/MainMenu/CPMainMenu.lua +++ b/data/cdata/ui_scripts/MainMenu/CPMainMenu.lua @@ -1,11 +1,11 @@ local CPMainMenu_original = MenuBuilder.m_types["CPMainMenu"] function CPMainMenuStub(menu, controller) - ret = CPMainMenu_original(menu, controller) + ret = CPMainMenu_original(menu, controller) - -- play music immediately - Engine.PlayMusic(CoD.Music.MainCPMusic) + -- play music immediately + Engine.PlayMusic(CoD.Music.MainCPMusic) - return ret + return ret end MenuBuilder.m_types["CPMainMenu"] = CPMainMenuStub diff --git a/data/cdata/ui_scripts/MainMenu/CPMainMenuButtons.lua b/data/cdata/ui_scripts/MainMenu/CPMainMenuButtons.lua deleted file mode 100644 index c5cb8216..00000000 --- a/data/cdata/ui_scripts/MainMenu/CPMainMenuButtons.lua +++ /dev/null @@ -1,201 +0,0 @@ -local f0_local0 = function(arg0, arg1) - Engine.Exec("xblive_privatematch 0") - utils.cp.AliensUtils.AliensRunConfig(arg1.controller) - LUI.FlowManager.RequestAddMenu("SystemLinkMenu", false, arg1.controller, false, {}, true) -end - -local f0_local1 = function(arg0, arg1) - f0_local0(arg0, arg1) -end - -local f0_local2 = function(arg0, arg1) - Engine.Exec(MPConfig.default_xboxlive, arg1.controller) - Engine.SetDvarBool("xblive_privatematch", true) - SetIsAliensSolo(true) - Engine.SetDvarInt("party_maxplayers", 1) - Engine.Exec("xstartprivatematch") - LUI.FlowManager.RequestAddMenu("CPPrivateMatchMenu", false, arg1.controller, false, { - showPlayNowButton = true, - isPublicMatch = false - }) -end - -local f0_local3 = function(arg0, arg1) - Engine.Exec(MPConfig.default_xboxlive, arg1.controller) - Engine.SetDvarBool("xblive_privatematch", true) - SetIsAliensSolo(false) - Engine.Exec("xstartprivatematch") - LUI.FlowManager.RequestAddMenu("CPPrivateMatchMenu", false, arg1.controller, false, { - showPlayNowButton = true, - isPublicMatch = false - }) -end - -local f0_local4 = function(arg0, arg1, arg2) - assert(arg0.PublicMatch) - assert(arg0.SoloMatch) - assert(arg0.CustomMatch) - local f5_local0 = LUI.DataSourceInGlobalModel.new("frontEnd.lobby.areWeGameHost") - local f5_local1 = DataSources.frontEnd.lobby.memberCount - local f5_local2 = function() - return Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost() - end - - local f5_local3 = function() - local f7_local0 = f5_local2() - arg0.PublicMatch:SetButtonDisabled(f7_local0) - arg0.CustomMatch:SetButtonDisabled(f7_local0) - end - - arg0:SubscribeToModel(f5_local0:GetModel(arg1), f5_local3) - arg0:SubscribeToModel(f5_local1:GetModel(arg1), f5_local3) - arg0:SubscribeToModel(DataSources.frontEnd.lobby.isSolo:GetModel(arg1), function() - local f8_local0 = DataSources.frontEnd.lobby.isSolo:GetValue(arg1) - if f8_local0 ~= nil then - arg0.SoloMatch:SetButtonDisabled(not f8_local0) - end - end) - arg0.PublicMatch:addEventHandler("button_action", f0_local1) - arg0.SoloMatch:addEventHandler("button_action", f0_local2) - arg0.Loadout:addEventHandler("button_action", function(f9_arg0, f9_arg1) - LUI.FlowManager.RequestAddMenu("CPLoadoutMenu", true, f9_arg1.controller) - end) - arg0.Barracks:addEventHandler("button_action", function(f10_arg0, f10_arg1) - LUI.FlowManager.RequestAddMenu("Headquarters", true, f10_arg1.controller) - end) - arg0.Armory:addEventHandler("button_action", function(f11_arg0, f11_arg1) - if not Engine.IsUserAGuest(f11_arg1.controller) then - ACTIONS.OpenMenu("Armory", true, f11_arg1.controller) - end - end) - arg0.CustomMatch:addEventHandler("button_action", f0_local3) - arg0.ContractsButton:addEventHandler("button_action", function(f12_arg0, f12_arg1) - ACTIONS.OpenMenu("ContractMenu", true, f12_arg1.controller or arg1) - end) - - arg0.ModsButton:addEventHandler("button_action", function(arg0, arg1) - LUI.FlowManager.RequestAddMenu("ModSelectMenu", true, arg1.controller, false) - end) -end - -function CPMainMenuButtons(menu, controller) - local VNavigator = LUI.UIVerticalNavigator.new() - VNavigator:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 400 * _1080p) - VNavigator.id = "CPMainMenuButtons" - local controllerIndex = controller and controller.controllerIndex - if not controllerIndex and not Engine.InFrontend() then - controllerIndex = VNavigator:getRootController() - end - assert(controllerIndex) - - local ButtonDescription = nil - - ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", { - controllerIndex = controllerIndex - }) - ButtonDescription.id = "ButtonDescription" - ButtonDescription:SetRGBFromTable(SWATCHES.genericButton.textDisabled, 0) - ButtonDescription.Description:SetRight(_1080p * 415, 0) - ButtonDescription:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 336, _1080p * 394) - VNavigator:addElement(ButtonDescription) - VNavigator.ButtonDescription = ButtonDescription - - local PublicMatch = nil - - PublicMatch = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - PublicMatch.id = "PublicMatch" - PublicMatch.buttonDescription = "Browse for Custom Servers" - PublicMatch.Text:setText(ToUpperCase("Server Browser"), 0) - PublicMatch:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, 0, _1080p * 30) - VNavigator:addElement(PublicMatch) - VNavigator.PublicMatch = PublicMatch - - local SoloMatch = nil - - SoloMatch = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - SoloMatch.id = "SoloMatch" - SoloMatch.buttonDescription = Engine.Localize("LUA_MENU_ZM_SOLO_MATCH_DESC") - SoloMatch.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_SOLO_MATCH_CAPS")), 0) - SoloMatch:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 40, _1080p * 70) - VNavigator:addElement(SoloMatch) - VNavigator.SoloMatch = SoloMatch - - local CustomMatch = nil - - CustomMatch = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - CustomMatch.id = "CustomMatch" - CustomMatch.buttonDescription = Engine.Localize("LUA_MENU_ZM_CUSTOM_MATCH_DESC") - CustomMatch.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_CUSTOM_GAME_CAPS")), 0) - CustomMatch:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 80, _1080p * 110) - VNavigator:addElement(CustomMatch) - VNavigator.CustomMatch = CustomMatch - - local Loadout = nil - - Loadout = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - Loadout.id = "Loadout" - Loadout.buttonDescription = Engine.Localize("LUA_MENU_ZM_LOADOUT_DESC") - Loadout.Text:setText(Engine.Localize("LUA_MENU_ZM_LOADOUT_CAPS"), 0) - Loadout:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 120, _1080p * 150) - VNavigator:addElement(Loadout) - VNavigator.Loadout = Loadout - - local Barracks = nil - - Barracks = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - Barracks.id = "Barracks" - Barracks.buttonDescription = Engine.Localize("LUA_MENU_ZM_BARRACKS_DESC") - Barracks.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_ZM_BARRACKS_CAPS")), 0) - Barracks:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 160, _1080p * 190) - VNavigator:addElement(Barracks) - VNavigator.Barracks = Barracks - - local Armory = nil - - Armory = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - Armory.id = "Armory" - Armory.buttonDescription = Engine.Localize("LUA_MENU_ZM_SURVIVAL_DEPOT_DESC") - Armory.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_ZM_SURVIVAL_DEPOT")), 0) - Armory:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 200, _1080p * 230) - VNavigator:addElement(Armory) - VNavigator.Armory = Armory - - local ModsButton = nil - - ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - ModsButton.id = "ModsButton" - ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC") - ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0) - ModsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 240, _1080p * 270) - VNavigator:addElement(ModsButton) - VNavigator.ModsButton = ModsButton - - local ContractsButton = nil - - ContractsButton = MenuBuilder.BuildRegisteredType("ContractsButtonCP", { - controllerIndex = controllerIndex - }) - ContractsButton.id = "ContractsButton" - ContractsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 340, _1080p * 280, _1080p * 340) - VNavigator:addElement(ContractsButton) - VNavigator.ContractsButton = ContractsButton - - f0_local4(VNavigator, controllerIndex, controller) - return VNavigator -end - -MenuBuilder.m_types["CPMainMenuButtons"] = CPMainMenuButtons diff --git a/data/cdata/ui_scripts/MainMenu/CampaignMenuButtons.lua b/data/cdata/ui_scripts/MainMenu/CampaignMenuButtons.lua deleted file mode 100644 index 95c9f765..00000000 --- a/data/cdata/ui_scripts/MainMenu/CampaignMenuButtons.lua +++ /dev/null @@ -1,189 +0,0 @@ -local f0_local0 = function ( f1_arg0 ) - if Engine.HasCompletedAnyLevel( f1_arg0 ) then - return true - end - local f1_local0 = {} - for f1_local1 = 0, Engine.TableGetRowCount( CSV.levels.file ) - 1, 1 do - local f1_local4 = CSV.ReadRow( CSV.levels, f1_local1 ) - local f1_local5 = f1_local4.name - if not Engine.GetDvarBool( "lui_checkIfLevelInFileSystem" ) or Engine.IsLevelInFileSystem and Engine.IsLevelInFileSystem( f1_local5 ) then - f1_local0[#f1_local0 + 1] = { - buttonLabel = f1_local4.string, - levelName = f1_local5, - objectiveText = f1_local4.desc, - levelNumber = f1_local4.ref, - completedLevelIndex = f1_local4.completedRef, - image = f1_local4.image - } - end - end - local f1_local1 = LUI.DataSourceFromPlayerData.new( CoD.ProgressionBlob.Gold, CoD.PlayMode.SP ) - local f1_local2 = f1_local1.spData - for f1_local3 = 1, #f1_local0, 1 do - local f1_local7 = f1_local0[f1_local3].levelName - if f1_local7 ~= "europa" then - local f1_local8 = "" - if f1_local2.missionStateData[f1_local7] ~= nil then - f1_local8 = f1_local2.missionStateData[f1_local7]:GetValue( f1_arg0 ) - end - if f1_local8 ~= nil and (f1_local8 == "complete" or f1_local8 == "incomplete") then - return true - end - end - end - return false -end - -local f0_local1 = function(arg0) - arg0.ResumeButton:SetButtonDisabled(not Engine.CanResumeGame(arg0._controllerIndex)) - if not CONDITIONS.IsTrialLicense(arg0) then - local f2_local0 = arg0.MissionSelectButton - local f2_local1 = f2_local0 - f2_local0 = f2_local0.SetButtonDisabled - local f2_local2 = Engine.IsTrialLicense() - if not f2_local2 then - if not Engine.IsDevelopmentBuild() and not Engine.GetDvarBool("mis_cheat") then - f2_local2 = not f0_local0(arg0._controllerIndex) - else - f2_local2 = false - end - end - f2_local0(f2_local1, f2_local2) - end -end - -local f0_local3 = function(arg0, arg1) - LUI.FlowManager.RequestPopupMenu(nil, "FakeLoadingScreenOverlay", true, 0, false, { - onLoadCompleteFunc = function() - Engine.Exec("set ui_play_credits 1; map shipcrib_epilogue") - end - }) -end - -local f0_local4 = function(arg0, arg1, arg2) - assert(arg0.ResumeButton) - assert(arg0.NewButton) - assert(arg0.CreditsButton) - if not CONDITIONS.IsTrialLicense(arg0) then - assert(arg0.MissionSelectButton) - end - arg0._controllerIndex = arg1 - arg0.ResumeButton:addEventHandler("button_action", function(f9_arg0, f9_arg1) - Engine.SetDvarString("start", "") - LUI.FlowManager.RequestPopupMenu(f9_arg0, "ResumeGamePopup", false, f9_arg1.controller, false) - end) - arg0.NewButton:addEventHandler("button_action", function(f10_arg0, f10_arg1) - Engine.SetDvarString("start", "") - if Engine.CanResumeGame(arg1) then - LUI.FlowManager.RequestPopupMenu(arg0, "overwrite_warning_menu", true, f10_arg1.controller) - else - LUI.FlowManager.RequestPopupMenu(arg0, "popmenu_autosave_warning", true, f10_arg1.controller) - end - end) - if not CONDITIONS.IsTrialLicense(arg0) then - arg0.MissionSelectButton:addEventHandler("button_action", function(f11_arg0, f11_arg1) - Engine.SetDvarString("start", "") - LUI.FlowManager.RequestAddMenu("LevelSelectMenu", true, f11_arg1.controller, false) - end) - end - arg0.CreditsButton:addEventHandler("button_action", f0_local3) - f0_local1(arg0) - arg0:addEventHandler("update_save_game_available_complete", f0_local1) - if Engine.GetDvarFloat("r_filmGrainAtten") == 0.25 then - Engine.SetDvarFloat("r_filmGrainAtten", 1) - Engine.ExecNow("profile_setFilmGrain " .. tostring(1), arg1) - end - - arg0.ModsButton:addEventHandler("button_action", function(arg0, arg1) - LUI.FlowManager.RequestAddMenu("ModSelectMenu", true, arg1.controller, false) - end) -end - -function CampaignMenuButtons(menu, controller) - local self = LUI.UIVerticalList.new() - self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 440 * _1080p) - self.id = "CampaignMenuButtons" - local controllerIndex = controller and controller.controllerIndex - if not controllerIndex and not Engine.InFrontend() then - controllerIndex = self:getRootController() - end - assert(controllerIndex) - self:SetSpacing(10 * _1080p) - - local ResumeButton = nil - - ResumeButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - ResumeButton.id = "ResumeButton" - ResumeButton.buttonDescription = Engine.Localize("LUA_MENU_RESUME_GAME_DESC") - ResumeButton.Text:setText(Engine.Localize("MENU_RESUMEGAME_CAPS"), 0) - ResumeButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, 0, _1080p * 30) - self:addElement(ResumeButton) - self.ResumeButton = ResumeButton - - local NewButton = nil - - NewButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - NewButton.id = "NewButton" - NewButton.buttonDescription = Engine.Localize("LUA_MENU_NEW_GAME_DESC") - NewButton.Text:setText(Engine.Localize("MENU_NEWGAME_CAPS"), 0) - NewButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70) - self:addElement(NewButton) - self.NewButton = NewButton - - local MissionSelectButton = nil - if not CONDITIONS.IsTrialLicense(self) then - MissionSelectButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - MissionSelectButton.id = "MissionSelectButton" - if not CONDITIONS.IsTrialLicense(self) then - MissionSelectButton.buttonDescription = Engine.Localize("LUA_MENU_MISSION_SELECT_DESC") - end - MissionSelectButton.Text:setText(Engine.Localize("MENU_MISSION_SELECT_CAPS"), 0) - MissionSelectButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110) - self:addElement(MissionSelectButton) - self.MissionSelectButton = MissionSelectButton - end - local CreditsButton = nil - - CreditsButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - CreditsButton.id = "CreditsButton" - CreditsButton.buttonDescription = Engine.Localize("LUA_MENU_CREDITS_DESC") - CreditsButton.Text:setText(ToUpperCase(Engine.Localize("MENU_SP_CREDITS_CAPS")), 0) - CreditsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150) - self:addElement(CreditsButton) - self.CreditsButton = CreditsButton - - local ModsButton = nil - - ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - ModsButton.id = "ModsButton" - ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC") - ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0) - ModsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 160, _1080p * 190) - self:addElement(ModsButton) - self.ModsButton = ModsButton - - local ButtonDescription = nil - - ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", { - controllerIndex = controllerIndex - }) - ButtonDescription.id = "ButtonDescription" - ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, _1080p * 200, _1080p * 300) - self:addElement(ButtonDescription) - self.ButtonDescription = ButtonDescription - - f0_local4(self, controllerIndex, controller) - return self -end - -MenuBuilder.m_types["CampaignMenuButtons"] = CampaignMenuButtons diff --git a/data/cdata/ui_scripts/MainMenu/MPMainMenu.lua b/data/cdata/ui_scripts/MainMenu/MPMainMenu.lua deleted file mode 100644 index ea82dd6b..00000000 --- a/data/cdata/ui_scripts/MainMenu/MPMainMenu.lua +++ /dev/null @@ -1,450 +0,0 @@ -LUI.FlowManager.RegisterFenceGroup("MPMainMenu", { - "mp", - "mpInstall", - "onlineServices", - "onlineData", - "patch", - "exchange", - "playlists", - "dailyReward" -}) - -LUI.FlowManager.RequestSetStack("MPMainMenu", { - { name = "MainLockoutMenu" }, - { name = "MainMenu" } -}) - -local HandleSplitscreenRefresh = function () - if Engine.SplitscreenPlayerCount() > 0 then - local activeController = Engine.GetFirstActiveController() - if activeController and Engine.IsUserSignedIn(activeController) then - Engine.PLMRefreshData() - end - end -end - -local HandleBackButton = function(f2_arg0, f2_arg1) - local f2_local0 = Engine.HasActiveLocalClient( f2_arg1.controller ) - if f2_local0 then - f2_local0 = not Engine.IsActiveLocalClientPrimary( f2_arg1.controller ) - end - if f2_local0 then - local f2_local1 = LUI.FlowManager.GetScopedData( f2_arg0 ) - if f2_local1 and f2_local1.focusedPage and f2_local1.focusedPage > 2 then - f2_arg0:dispatchEventToRoot( { - name = "lobby_slide_left", - immediate = true - } ) - end - elseif Lobby.IsNotAloneInPrivateParty() then - if Engine.IsXB3() then - LUI.FlowManager.RequestPopupMenu( f2_arg0, "RateLimitedLeaveCommonMPMainMenuPopup", true, f2_arg1.controller, false, { - menu = f2_arg0, - rateLimitIntervalMS = 5000, - rateLimitAttempts = 3 - } ) - else - LUI.FlowManager.RequestPopupMenu( f2_arg0, "LeaveCommonMPMainMenuPopup", true, f2_arg1.controller, false, { - menu = f2_arg0 - } ) - end - else - Lobby.LeaveCommonMPMainMenu( f2_arg0, f2_arg1.controller ) - end - return true -end - -local InitializeMainMenu = function(arg0, arg1) - local activeController = Engine.GetFirstActiveController() - if Engine.GetDvarBool("xblive_competitionmatch") then - Engine.SetDvarBool("xblive_competitionmatch", false) - Engine.Exec("set remove_mlg_rules 1") - end - Engine.ExecNow(MPConfig.default_xboxlive, activeController) -end - -local UpdatePlayerData = function(arg0) - local postShipFlag = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.Ranked, "postShipFlags", 3) - if postShipFlag == nil or postShipFlag == false then - local archetypePreferences = { - { "head", 1, "head_160", "head_287" }, - { "head", 3, "head_167", "head_294" }, - { "body", 1, "body_90", "body_217" }, - { "body", 3, "body_97", "body_224" } - } - - for _, pref in ipairs(archetypePreferences) do - local currentValue = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "archetypePreferences", pref[2], pref[1]) - if currentValue ~= nil and currentValue == pref[3] then - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "archetypePreferences", pref[2], pref[1], pref[4]) - end - end - - local headData = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "head") - local bodyData = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "body") - - if headData ~= nil and (headData == 160 or headData == 167) then - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "head", headData == 160 and 287 or 294) - end - if bodyData ~= nil and (bodyData == 90 or bodyData == 97) then - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "body", bodyData == 90 and 217 or 224) - end - - -- Same operation for private loadouts - for _, pref in ipairs(archetypePreferences) do - local currentValue = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.PrivateLoadouts, "squadMembers", "archetypePreferences", pref[2], pref[1]) - if currentValue ~= nil and currentValue == pref[3] then - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.PrivateLoadouts, "squadMembers", "archetypePreferences", pref[2], pref[1], pref[4]) - end - end - - local privateHeadData = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.PrivateLoadouts, "squadMembers", "head") - local privateBodyData = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.PrivateLoadouts, "squadMembers", "body") - - if privateHeadData ~= nil and (privateHeadData == 160 or privateHeadData == 167) then - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.PrivateLoadouts, "squadMembers", "head", privateHeadData == 160 and 287 or 294) - end - if privateBodyData ~= nil and (privateBodyData == 90 or privateBodyData == 97) then - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.PrivateLoadouts, "squadMembers", "body", privateBodyData == 90 and 217 or 224) - end - - local characterHead = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "head") - local characterBody = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "body") - local characterSuper = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "archetypeSuper") - local characterArchetype = Engine.GetPlayerDataEx(arg0, CoD.StatsGroup.RankedLoadouts, "squadMembers", "archetype") - - if characterHead ~= nil and characterBody ~= nil then - FrontEndScene.SetCharacterModelsByIndex(FrontEndScene.ClientCharacters.Self, characterBody, characterHead) - end - - if characterSuper ~= nil and characterArchetype ~= nil then - FrontEndScene.SetWeaponForSuper(FrontEndScene.ClientCharacters.Self, characterSuper, characterArchetype) - FrontEndScene.PlayIdleForSuper(FrontEndScene.ClientCharacters.Self, characterSuper, characterArchetype) - end - - Engine.SetPlayerDataEx(arg0, CoD.StatsGroup.Ranked, "postShipFlags", 3, true) - Engine.ExecNow("uploadstats", arg0) - end -end - -local LoadMainMenu = function(controller) - UpdatePlayerData(controller) -end - --- Function to set up the main menu for multiplayer -local SetupMainMenu = function(menu, controller) - -- Disable UI version display and online requirement - Engine.SetDvarString("ui_version_show", "0") - Engine.SetDvarBool("ui_onlineRequired", false) - - -- Set up front end scene - FrontEndScene.CurrentMissionTeam = MissionDirector.InvalidTeamID - FrontEndScene.SetScene("mp_main") - - -- Get controller index - local controllerIndex = controller and controller.controller or Engine.GetFirstActiveController() - - -- Check title update requirement - CheckTURequirement(menu, controllerIndex) - - -- Set up player character based on loadout data - local loadoutData = DataSources.alwaysLoaded.playerData.MP.rankedloadouts.squadMembers - local rigAnim = Cac.GetRigFrontEndProfileAnim(loadoutData.archetype:GetValue(controllerIndex)) - FrontEndScene.SetCharacterModelsByIndex( - FrontEndScene.ClientCharacters.Profile, - loadoutData.body:GetValue(controllerIndex), - loadoutData.head:GetValue(controllerIndex) - ) - ClientCharacter.SetCharacterWeapons(FrontEndScene.ClientCharacters.Profile, nil) - ClientCharacter.PlayCharacterAnim(FrontEndScene.ClientCharacters.Profile, rigAnim) - ClientCharacter.SetCharacterVisible(FrontEndScene.ClientCharacters.Profile, true) - - -- Set up weapon visibility - ClientWeapon.SetWeaponIsViewModel(0, true) - ClientWeapon.SetWeaponVisible(0, false) - - -- Initialize main menu - InitializeMainMenu(menu, controller) - - -- Sync unlocks if enabled - if Engine.GetDvarBool("enable_unlock_sync") then - local unlockTypes = {} - for _, unlockType in pairs(AAR.UnlockTypes) do - table.insert(unlockTypes, unlockType) - end - Rewards.SyncUnlocks(controllerIndex, unlockTypes, #unlockTypes) - end - - -- Start private party if not already in one - if not Lobby.IsInPrivateParty() then - Engine.ExecNow("xstartprivateparty", controllerIndex) - end - - -- Handle events related to party and CRM (Customer Relationship Management) - menu:registerEventHandler("not_below_blocking_fence", function() - Engine.SetDvarBool("cg_mlg_gamebattles_match", false) - if not MLG.IsGameBattleMatch() then - Lobby.WakePrivateParty(controllerIndex) - end - end) - - -- Set up party UI and CRM - Lobby.SetPartyUIRoot(PartyUIRoot.MAIN_MENU) - menu.nextLocation = CRM.locations.MP_MOTD - CRM.OpenNextCRMWindow(menu) - menu:addEventHandler("gain_focus", CRM.OpenNextCRMWindow) - menu:addEventHandler("restore_focus", CRM.OpenNextCRMWindow) -end - --- Post-load function to handle game battles and other settings -local PostLoadFunc = function(menu, controllerIndex, controller) - if GAMEBATTLES.ScheduleRefreshRequest then - GAMEBATTLES.ScheduleRefreshRequest = false - OpenGameBattlesLobby(controllerIndex) - else - local currentMatch = GAMEBATTLES.GetCurrentMatch(controllerIndex) - if currentMatch then - if GAMEBATTLES.MatchForfeitWinningTeamIndex ~= 0 then - GAMEBATTLES.ShowMatchForfeitPopup(controllerIndex, currentMatch, GAMEBATTLES.MatchForfeitWinningTeamIndex) - GAMEBATTLES.MatchForfeitWinningTeamIndex = 0 - else - local victoryInfo, progressInfo = GAMEBATTLES.GetMatchProgressInfo(currentMatch) - if progressInfo then - local alliesWins, axisWins, matchVictory = GAMEBATTLES.GetMatchVictoryInfo(currentMatch) - if not matchVictory then - LUI.FlowManager.RequestPopupMenu(menu, "MLGGamebattlesMatchResultsPopup", false, controllerIndex, false, { - controllerIndex = controllerIndex, - gbMatch = currentMatch, - alliesWins = alliesWins, - axisWins = axisWins - }) - end - else - local dsAcquisitionState = MLG.GetGameBattleDSAcquisitionState(controllerIndex) - if dsAcquisitionState == GAMEBATTLES.MLG_DS_ACQUISITION_STATE.COULD_NOT_ACQUIRE or dsAcquisitionState == GAMEBATTLES.MLG_DS_ACQUISITION_STATE.ACQUISITION_ERROR then - MLG.ResetGameBattleDSAcquisitionState() - LUI.FlowManager.RequestPopupMenu(menu, "MLGGamebattlesMatchCancelledPopup", false, controllerIndex, false, { - matchID = currentMatch.matchId - }) - end - end - end - MLG.ResetGameBattleMatchId(controllerIndex) - end - end - - -- Additional setup and event handling - assert(menu.bindButton) - menu.isSignInMenu = true - menu.bindButton:addEventHandler("button_secondary", HandleBackButton) - menu:addEventHandler("menu_create", SetupMainMenu) - - -- Adjust UI elements based on various conditions - local adjustButtonDescription = function() - local _, top, _, bottom = menu.ButtonDescription:getLocalRect() - local buttonSpacing = menu.MPMainMenuButtons.buttonSpacing - menu.ButtonDescription:SetTop(top - buttonSpacing) - menu.ButtonDescription:SetBottom(bottom - buttonSpacing) - end - - if not CONDITIONS.IsGameBattlesAllowed() then - adjustButtonDescription() - end - - if not CODTV.IsCODTVEnabled() then - adjustButtonDescription() - end - - if not CONDITIONS.IsStoreAllowed(menu) then - adjustButtonDescription() - end - - if Engine.GetDvarFloat("r_filmGrainAtten") == 1 then - Engine.SetDvarFloat("r_filmGrainAtten", 0.25) - Engine.ExecNow("profile_setFilmGrain " .. tostring(0.25), controllerIndex) - end - - -- Handle NAT type warning - local natType = Lobby.GetNATType() - if natType then - if natType == "NETWORK_STRICT" and not Engine.GetDvarBool("strict_nat_warning_viewed") then - LUI.FlowManager.RequestPopupMenu(menu, "strict_nat_warning", true, controllerIndex, false, data) - Engine.SetDvarBool("strict_nat_warning_viewed", true) - end - menu:processEvent({ - name = "add_button_helper_text", - button_ref = "nat", - helper_text = Engine.Localize("NETWORK_YOURNATTYPE", natType), - side = "right", - clickable = false - }) - end - - Engine.SetDvarInt("lui_mc_numGamesFinishedInLobby", 0) - MissionDirector.PlayTeamMusic() - Engine.StopMenuVideo() - - -- Handle trial license popup - local scopedData = LUI.FlowManager.GetScopedData(menu) - if CONDITIONS.IsTrialLicense() and not scopedData.trialPopupShown then - scopedData.trialPopupShown = true - LUI.FlowManager.RequestPopupMenu(menu, "TrialFullWindow", true, controllerIndex, false) - end - - menu:addElement(Lobby.GetMPMapMaterialStreamer()) - LoadMainMenu(controllerIndex) -end - -function MPMainMenu(menu, controller) - local self = LUI.UIHorizontalNavigator.new() - self.id = "MPMainMenu" - - -- Determine controller index - local controllerIndex = controller and controller.controllerIndex - if not controllerIndex and not Engine.InFrontend() then - controllerIndex = self:getRootController() - end - assert(controllerIndex) - - -- Initialize the main menu - InitializeMainMenu(self, controllerIndex, controller) - self:playSound("menu_open") - - -- Helper bar - local HelperBar = MenuBuilder.BuildRegisteredType("ButtonHelperBar", { - controllerIndex = controllerIndex - }) - HelperBar.id = "HelperBar" - HelperBar:SetAnchorsAndPosition(0, 0, 1, 0, 0, 0, _1080p * -85, 0) - self:addElement(HelperBar) - self.HelperBar = HelperBar - - -- Button description - local ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", { - controllerIndex = controllerIndex - }) - ButtonDescription.id = "ButtonDescription" - ButtonDescription.Description:SetRight(_1080p * 415, 0) - ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 130, _1080p * 645, _1080p * 594, _1080p * 694) - self:addElement(ButtonDescription) - self.ButtonDescription = ButtonDescription - - -- Social feed - local SocialFeed = MenuBuilder.BuildRegisteredType("SocialFeed", { - controllerIndex = controllerIndex - }) - SocialFeed.id = "SocialFeed" - SocialFeed:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 1920, _1080p * 965, _1080p * 995) - self:addElement(SocialFeed) - self.SocialFeed = SocialFeed - - -- Main menu buttons - local MPMainMenuButtons = MenuBuilder.BuildRegisteredType("MPMainMenuButtons", { - controllerIndex = controllerIndex - }) - MPMainMenuButtons.id = "MPMainMenuButtons" - MPMainMenuButtons:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 130, _1080p * 630, _1080p * 360, _1080p * 564) - self:addElement(MPMainMenuButtons) - self.MPMainMenuButtons = MPMainMenuButtons - - -- Friends widget - local FriendsElement = MenuBuilder.BuildRegisteredType("online_friends_widget", { - controllerIndex = controllerIndex - }) - FriendsElement.id = "FriendsElement" - FriendsElement:SetFont(FONTS.GetFont(FONTS.Dev.File)) - FriendsElement:SetAlignment(LUI.Alignment.Left) - FriendsElement:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 1420, _1080p * 1920, _1080p * 1026, _1080p * 1071) - self:addElement(FriendsElement) - self.FriendsElement = FriendsElement - - -- Lobby members list - local LobbyMembers = MenuBuilder.BuildRegisteredType("LobbyMembers", { - controllerIndex = controllerIndex - }) - LobbyMembers.id = "LobbyMembers" - LobbyMembers:SetAnchorsAndPosition(1, 0, 0, 1, _1080p * -700, 0, _1080p * 273, _1080p * 917) - self:addElement(LobbyMembers) - self.LobbyMembers = LobbyMembers - - -- COD logo - local CODLogo = LUI.UIImage.new() - CODLogo.id = "CODLogo" - CODLogo:setImage(RegisterMaterial("cod_logo"), 0) - CODLogo:SetAnchorsAndPosition(0, 0, 0, 0, _1080p * 108, _1080p * -1272, _1080p * 120, _1080p * -825) - self:addElement(CODLogo) - self.CODLogo = CODLogo - - -- Menu title - local MenuTitle = LUI.UIStyledText.new() - MenuTitle.id = "MenuTitle" - MenuTitle:setText(ToUpperCase(Engine.Localize("MENU_MULTIPLAYER")), 0) - MenuTitle:SetFontSize(50 * _1080p) - MenuTitle:SetFont(FONTS.GetFont(FONTS.MainMedium.File)) - MenuTitle:SetAlignment(LUI.Alignment.Left) - MenuTitle:SetStartupDelay(1250) - MenuTitle:SetLineHoldTime(400) - MenuTitle:SetAnimMoveTime(300) - MenuTitle:SetEndDelay(1000) - MenuTitle:SetCrossfadeTime(500) - MenuTitle:SetAutoScrollStyle(LUI.UIStyledText.AutoScrollStyle.ScrollH) - MenuTitle:SetMaxVisibleLines(1) - MenuTitle:SetDecodeLetterLength(25) - MenuTitle:SetDecodeMaxRandChars(3) - MenuTitle:SetDecodeUpdatesPerLetter(4) - MenuTitle:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 130, _1080p * 660, _1080p * 296.5, _1080p * 346.5) - self:addElement(MenuTitle) - self.MenuTitle = MenuTitle - - -- Double XP notifications - local DoubleXPNotifications = MenuBuilder.BuildRegisteredType("DoubleXPNotifications", { - controllerIndex = controllerIndex - }) - DoubleXPNotifications.id = "DoubleXPNotifications" - DoubleXPNotifications:SetScale(-0.5, 0) - DoubleXPNotifications:SetAnchorsAndPosition(0.5, 0.5, 0, 1, _1080p * -370, _1080p * -114, _1080p * 104, _1080p * 232) - self:addElement(DoubleXPNotifications) - self.DoubleXPNotifications = DoubleXPNotifications - - -- Button helper function - self.addButtonHelperFunction = function(arg0, arg1) - arg0:AddButtonHelperText({ - helper_text = Engine.Localize("LUA_MENU_SELECT"), - button_ref = "button_primary", - side = "left", - clickable = true - }) - arg0:AddButtonHelperText({ - helper_text = Engine.Localize("MENU_BACK"), - button_ref = "button_secondary", - side = "left", - priority = 1, - clickable = true - }) - arg0:AddButtonHelperText({ - helper_text = Engine.Localize("LUA_MENU_OPTIONS_CAPS"), - button_ref = "button_start", - side = "left", - priority = 4, - clickable = true - }) - end - - self:addEventHandler("menu_create", self.addButtonHelperFunction) - - -- Bind button handler - local bindButton = LUI.UIBindButton.new() - bindButton.id = "selfBindButton" - self:addElement(bindButton) - self.bindButton = bindButton - - self.bindButton:addEventHandler("button_start", function(arg0, arg1) - ACTIONS.OpenMenu("OptionsMenu", true, arg1.controller or controllerIndex) - end) - - PostLoadFunc(self, controllerIndex, controller) - return self -end - -MenuBuilder.m_types["MPMainMenu"] = MPMainMenu -LUI.FlowManager.RegisterStackPushBehaviour( "MPMainMenu", PushFunc ) \ No newline at end of file diff --git a/data/cdata/ui_scripts/MainMenu/MPMainMenuButtons.lua b/data/cdata/ui_scripts/MainMenu/MPMainMenuButtons.lua deleted file mode 100644 index 0fd80621..00000000 --- a/data/cdata/ui_scripts/MainMenu/MPMainMenuButtons.lua +++ /dev/null @@ -1,208 +0,0 @@ -local buttonSpacing = 40 -local f0_local1 = 10 -local f0_local2 = function(f1_arg0, f1_arg1, f1_arg2) - if 0 < f1_arg2 then - local f1_local0, f1_local1, f1_local2, f1_local3 = f1_arg0:getLocalRect() - local f1_local4 = f1_local3 - f1_local1 - f1_arg0:SetTop(f1_local1 - (f1_local4 + f1_arg1) * f1_arg2) - f1_arg0:SetBottom(f1_local3 - (f1_local4 + f1_arg1) * f1_arg2) - end -end - -local f0_local3 = function(f2_arg0, f2_arg1, f2_arg2) - assert(f2_arg0.ConquestButton) - if CONDITIONS.IsStoreAllowed(f2_arg0) then - assert(f2_arg0.StoreButton) - end - local f2_local0 = not CONDITIONS.IsTrialLicense(f2_arg0) - if f2_local0 then - assert(f2_arg0.CustomGameButton) - end - f2_arg0.buttonSpacing = _1080p * buttonSpacing - local f2_local1 = function() - return Lobby.IsInPrivateParty() and not Lobby.IsPrivatePartyHost() - end - - local f2_local2 = function() - local f4_local0 = f2_local1() - f2_arg0.ConquestButton:SetButtonDisabled(f4_local0) - if f2_arg0.MLGGameBattlesButton ~= nil then - f2_arg0.MLGGameBattlesButton:SetButtonDisabled(f4_local0) - end - if f2_local0 then - f2_arg0.CustomGameButton:SetButtonDisabled(f4_local0) - end - end - - local f2_local3 = LUI.DataSourceInGlobalModel.new("frontEnd.lobby.areWeGameHost") - local f2_local4 = DataSources.frontEnd.lobby.memberCount - f2_arg0:SubscribeToModel(f2_local3:GetModel(f2_arg1), f2_local2) - f2_arg0:SubscribeToModel(f2_local4:GetModel(f2_arg1), f2_local2) - f2_arg0.ConquestButton:addEventHandler("button_action", function(f5_arg0, f5_arg1) - Engine.SetDvarBool("cg_mlg_gamebattles_match", false) - local f5_local0 = function() - LUI.FlowManager.RequestAddMenu("Missions", false, f5_arg1.controller, false, {}, true) - end - - if not Onboarding:BeginFlow(Onboarding.RigTutorial, f2_arg1) then - f5_local0() - else - LUI.FlowManager.RequestPopupMenu(nil, "MPFullScreenVideoOverlay", true, f2_arg1, nil, { - videoRef = "mp_wolverines_mission_commander", - allowSkip = true, - doIntroFadeOut = false, - doIntroFadeIn = false, - doOutroFadeIn = true, - doOutroFadeOut = true, - fadeColor = COLORS.black - }, nil, true, true) - local f5_local1 = f2_arg0:Wait(500) - f5_local1.onComplete = f5_local0 - end - end) - if CONDITIONS.IsGameBattlesAllowed(f2_arg0) then - f2_arg0.MLGGameBattlesButton:addEventHandler("button_action", function(f7_arg0, f7_arg1) - if Engine.GetDvarBool("splitscreen") then - LUI.FlowManager.RequestPopupMenu(f2_arg0, "MLGGamebattlesSplitscreenPopup", true, f7_arg1.controller, - false, { - controllerIndex = f2_arg1 - }) - elseif Lobby.IsNotAloneInPrivateParty() then - LUI.FlowManager.RequestPopupMenu(f2_arg0, "DisbandPartyEnterGameBattlesLobbyPopup", true, - f7_arg1.controller, false, { - controllerIndex = f2_arg1 - }) - else - OpenGameBattlesLobby(f7_arg1.controller) - end - end) - end - if f2_local0 then - f2_arg0.CustomGameButton:addEventHandler("button_action", function(f8_arg0, f8_arg1) - OpenPrivateMatchLobby(f8_arg1) - end) - end - - f2_arg0.ModsButton:addEventHandler("button_action", function(arg0, arg1) - LUI.FlowManager.RequestAddMenu("ModSelectMenu", true, arg1.controller, false) - end) - - if CONDITIONS.IsStoreAllowed(f2_arg0) then - f2_arg0.StoreButton:addEventHandler("button_action", function(f9_arg0, f9_arg1) - local f9_local0 = STORE.GoToStore - local f9_local1 = f9_arg1.controller - local f9_local2 = f9_arg0:GetCurrentMenu() - f9_local0(f9_local1, f9_local2.id, f9_arg0.id) - end) - end - local f2_local5 = _1080p * f0_local1 - local f2_local6 = 0 - if f2_arg0.MLGGameBattlesButton == nil then - f2_local6 = 1 - end - if f2_arg0.CustomGameButton then - f0_local2(f2_arg0.CustomGameButton, f2_local5, f2_local6) - else - f2_local6 = f2_local6 + 1 - end - if f2_arg0.ModsButton then - f0_local2(f2_arg0.ModsButton, f2_local5, f2_local6) - else - f2_local6 = f2_local6 + 1 - end - if CONDITIONS.IsStoreAllowed(f2_arg0) then - f0_local2(f2_arg0.StoreButton, f2_local5, f2_local6) - else - f2_local6 = f2_local6 + 1 - end - if f2_arg0.StoreButton then - f2_arg0.StoreButton:SetButtonDescription(STORE.GetStoreDescription()) - if CONDITIONS.IsTrialLicense() then - f2_arg0.StoreButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_BUY_NOW"))) - end - end -end - -function MPMainMenuButtons(menu, controller) - local self = LUI.UIVerticalNavigator.new() - self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 190 * _1080p) - self.id = "MPMainMenuButtons" - local controllerIndex = controller and controller.controllerIndex - if not controllerIndex and not Engine.InFrontend() then - controllerIndex = self:getRootController() - end - assert(controllerIndex) - local ConquestButton = nil - - ConquestButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - ConquestButton.id = "ConquestButton" - ConquestButton.buttonDescription = Engine.Localize("LUA_MENU_PUBLIC_MATCH_DESC") - ConquestButton.Text:setText(Engine.Localize("LUA_MENU_PUBLIC_MATCH_CAPS"), 0) - ConquestButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, 0, _1080p * 30) - self:addElement(ConquestButton) - self.ConquestButton = ConquestButton - - local MLGGameBattlesButton = nil - if CONDITIONS.IsGameBattlesAllowed(self) then - MLGGameBattlesButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - MLGGameBattlesButton.id = "MLGGameBattlesButton" - if CONDITIONS.IsGameBattlesAllowed(self) then - - else - - end - if CONDITIONS.IsGameBattlesAllowed(self) then - MLGGameBattlesButton.buttonDescription = Engine.Localize("LUA_MENU_MLG_GAMEBATTLES_DESC") - end - MLGGameBattlesButton.Text:setText(Engine.Localize("LUA_MENU_MLG_GAMEBATTLES_CAPS"), 0) - MLGGameBattlesButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70) - self:addElement(MLGGameBattlesButton) - self.MLGGameBattlesButton = MLGGameBattlesButton - end - - local CustomGameButton = nil - - CustomGameButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - CustomGameButton.id = "CustomGameButton" - CustomGameButton.buttonDescription = Engine.Localize("LUA_MENU_CUSTOM_GAME_DESC") - CustomGameButton.Text:setText(Engine.Localize("LUA_MENU_CUSTOM_GAME_CAPS"), 0) - CustomGameButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 80, _1080p * 110) - self:addElement(CustomGameButton) - self.CustomGameButton = CustomGameButton - - local ModsButton = nil - - ModsButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - ModsButton.id = "ModsButton" - ModsButton.buttonDescription = Engine.Localize("LUA_MENU_MODS_DESC") - ModsButton.Text:setText(ToUpperCase(Engine.Localize("LUA_MENU_MODS_CAPS")), 0) - ModsButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 120, _1080p * 150) - self:addElement(ModsButton) - self.ModsButton = ModsButton - - local StoreButton = nil - if CONDITIONS.IsStoreAllowed(self) then - StoreButton = MenuBuilder.BuildRegisteredType("MenuButton", { - controllerIndex = controllerIndex - }) - StoreButton.id = "StoreButton" - StoreButton.buttonDescription = Engine.Localize("LUA_MENU_STORE_DESC") - StoreButton.Text:setText(Engine.Localize("LUA_MENU_STORE_CAPS"), 0) - StoreButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 160, _1080p * 190) - self:addElement(StoreButton) - self.StoreButton = StoreButton - end - - f0_local3(self, controllerIndex, controller) - return self -end - -MenuBuilder.m_types["MPMainMenuButtons"] = MPMainMenuButtons diff --git a/data/cdata/ui_scripts/MainMenu/MissionButtons.lua b/data/cdata/ui_scripts/MainMenu/MissionButtons.lua new file mode 100644 index 00000000..fff10b18 --- /dev/null +++ b/data/cdata/ui_scripts/MainMenu/MissionButtons.lua @@ -0,0 +1,51 @@ +function MissionsButtons(menu, controller) + local self = LUI.UIVerticalNavigator.new() + self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 380 * _1080p) + self.id = "MissionsButtons" + local f1_local1 = controller and controller.controllerIndex + if not f1_local1 and not Engine.InFrontend() then + f1_local1 = self:getRootController() + end + assert(f1_local1) + local MissionsVerticalLayout = MenuBuilder.BuildRegisteredType("MissionsVerticalLayout", { + controllerIndex = f1_local1, + }) + MissionsVerticalLayout.id = "MissionsVerticalLayout" + MissionsVerticalLayout:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, 0, _1080p * 340) + self:addElement(MissionsVerticalLayout) + self.MissionsVerticalLayout = MissionsVerticalLayout + + local FindMatchButton = MissionsVerticalLayout:getChildById("MissionSelect") + FindMatchButton.Text:setText(ToUpperCase(Engine.Localize("Combat Training")), 0) + FindMatchButton.buttonDescription = Engine.Localize("Rank up against bots.") + + local ServerBrowserButton = MenuBuilder.BuildRegisteredType("GenericButton", { + controllerIndex = f6_local1, + }) + ServerBrowserButton.id = "ServerBrowserButton" + ServerBrowserButton.Text:setText(ToUpperCase(Engine.Localize("Server Browser")), 0) + ServerBrowserButton.buttonDescription = Engine.Localize("Browse a list of dedicated servers.") + ServerBrowserButton:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 40, _1080p * 70) + LUI.UIElement.addElementBefore(ServerBrowserButton, MissionsVerticalLayout:getChildById("MissionSelect")) + MissionsVerticalLayout.ServerBrowserButton = ServerBrowserButton + ServerBrowserButton:addEventHandler("button_action", function(f14_arg0, f14_arg1) + LUI.FlowManager.RequestAddMenu("SystemLinkMenu", true, f14_arg1.controller, false, {}) + end) + + local CRMMain = MenuBuilder.BuildRegisteredType("CRMMain", { + controllerIndex = f1_local1, + }) + CRMMain.id = "CRMMain" + CRMMain:SetAnchorsAndPosition(0, 1, 0, 1, _1080p * 6, _1080p * 317, _1080p * 530, _1080p * 854) + self:addElement(CRMMain) + self.CRMMain = CRMMain + + ACTIONS.AnimateSequenceByElement(self, { + elementName = "CRMMain", + sequenceName = "Opening", + elementPath = "CRMMain", + }) + return self +end + +MenuBuilder.m_types["MissionsButtons"] = MissionsButtons diff --git a/data/cdata/ui_scripts/MainMenu/MissionsVerticalLayout.lua b/data/cdata/ui_scripts/MainMenu/MissionsVerticalLayout.lua deleted file mode 100644 index 195b2aa8..00000000 --- a/data/cdata/ui_scripts/MainMenu/MissionsVerticalLayout.lua +++ /dev/null @@ -1,160 +0,0 @@ -local f0_local0 = function(arg0, arg1, arg2) - assert(arg0.CreateAClassButton) - assert(arg0.MissionSelect) - local f1_local0 = LUI.DataSourceInGlobalModel.new("frontEnd.lobby.findMatchButtonWaitStatus") - arg0:SubscribeToModel(f1_local0:GetModel(arg1), function() - local f2_local0 = f1_local0:GetValue(arg1) - local f2_local1 = "Browse for Custom Servers" - if f2_local0 == "" then - arg0.MissionSelect:SetButtonDisabled(false) - else - arg0.MissionSelect:SetButtonDisabled(true) - f2_local1 = f2_local0 - end - arg0.MissionSelect.buttonDescription = f2_local1 - arg0.ButtonDescription:processEvent({ - name = "update_button_description", - text = f2_local1 - }) - end) - if not Onboarding.RigTutorial:WasCompleted(arg1) then - arg0.CreateAClassButton.listDefaultFocus = 0 - end - if not CONDITIONS.IsQuarterMasterAllowed(arg0) then - arg0.Barracks:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 120, _1080p * 150) - arg0.ButtonDescription:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 160, _1080p * 190) - end -end - -function MissionsVerticalLayout(menu, controller) - local self = LUI.UIVerticalList.new() - self:SetAnchorsAndPosition(0, 1, 0, 1, 0, 500 * _1080p, 0, 330 * _1080p) - self.id = "MissionsVerticalLayout" - self._animationSets = {} - self._sequences = {} - local controllerIndex = controller and controller.controllerIndex - if not controllerIndex and not Engine.InFrontend() then - controllerIndex = self:getRootController() - end - assert(controllerIndex) - - self:SetSpacing(10 * _1080p) - local MissionSelect = nil - - MissionSelect = MenuBuilder.BuildRegisteredType("GenericButton", { - controllerIndex = controllerIndex - }) - MissionSelect.id = "MissionSelect" - MissionSelect.buttonDescription = "Browse for Custom Servers" - MissionSelect.Text:setText(ToUpperCase("Server Browser"), 0) - MissionSelect:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, 0, _1080p * 30) - self:addElement(MissionSelect) - self.MissionSelect = MissionSelect - - local MissionTeams = nil - - MissionTeams = MenuBuilder.BuildRegisteredType("GenericButton", { - controllerIndex = controllerIndex - }) - MissionTeams.id = "MissionTeams" - MissionTeams.buttonDescription = Engine.Localize("LUA_MENU_DESC_MISSION_TEAMS") - MissionTeams.Text:setText(ToUpperCase(Engine.Localize("MENU_MISSION_TEAMS")), 0) - MissionTeams:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 40, _1080p * 70) - self:addElement(MissionTeams) - self.MissionTeams = MissionTeams - - local CreateAClassButton = nil - - CreateAClassButton = MenuBuilder.BuildRegisteredType("CreateAClassButton", { - controllerIndex = controllerIndex - }) - CreateAClassButton.id = "CreateAClassButton" - CreateAClassButton:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 80, _1080p * 110) - self:addElement(CreateAClassButton) - self.CreateAClassButton = CreateAClassButton - - local f3_local6 = nil - if CONDITIONS.IsQuarterMasterAllowed(self) then - f3_local6 = MenuBuilder.BuildRegisteredType("QuartermasterButton", { - controllerIndex = controllerIndex - }) - f3_local6.id = "Armory" - f3_local6:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 120, _1080p * 150) - self:addElement(f3_local6) - self.Armory = f3_local6 - end - local Barracks = nil - - Barracks = MenuBuilder.BuildRegisteredType("BarracksButton", { - controllerIndex = controllerIndex - }) - Barracks.id = "Barracks" - Barracks:SetAnchorsAndPosition(0, 0, 0, 1, 0, _1080p * -4, _1080p * 160, _1080p * 190) - self:addElement(Barracks) - self.Barracks = Barracks - - local f3_local8 = nil - if CONDITIONS.AreContractsEnabled(self) then - f3_local8 = MenuBuilder.BuildRegisteredType("ContractsButton", { - controllerIndex = controllerIndex - }) - f3_local8.id = "Contracts" - f3_local8:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 500, _1080p * 200, _1080p * 260) - self:addElement(f3_local8) - self.Contracts = f3_local8 - end - local ButtonDescription = nil - - ButtonDescription = MenuBuilder.BuildRegisteredType("ButtonDescriptionText", { - controllerIndex = controllerIndex - }) - ButtonDescription.id = "ButtonDescription" - ButtonDescription.Description:SetRight(_1080p * 415, 0) - ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, _1080p * 270, _1080p * 370) - self:addElement(ButtonDescription) - self.ButtonDescription = ButtonDescription - - self._animationSets.DefaultAnimationSet = function() - self._sequences.DefaultSequence = function() - - end - - CreateAClassButton:RegisterAnimationSequence("ContractsKillswitched", {{function() - return self.CreateAClassButton:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 80, _1080p * 110, 0) - end}}) - if CONDITIONS.IsQuarterMasterAllowed(self) then - f3_local6:RegisterAnimationSequence("ContractsKillswitched", {{function() - return self.Armory:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 120, _1080p * 150, 0) - end}}) - end - Barracks:RegisterAnimationSequence("ContractsKillswitched", {{function() - return self.Barracks:SetAnchorsAndPosition(0, 0, 0, 1, 0, 0, _1080p * 160, _1080p * 190, 0) - end}}) - ButtonDescription:RegisterAnimationSequence("ContractsKillswitched", {{function() - return self.ButtonDescription:SetAnchorsAndPosition(0, 1, 0, 1, 0, _1080p * 504, _1080p * 201, _1080p * 301, - 0) - end}}) - self._sequences.ContractsKillswitched = function() - CreateAClassButton:AnimateSequence("ContractsKillswitched") - if CONDITIONS.IsQuarterMasterAllowed(self) then - f3_local6:AnimateSequence("ContractsKillswitched") - end - Barracks:AnimateSequence("ContractsKillswitched") - ButtonDescription:AnimateSequence("ContractsKillswitched") - end - - end - - self._animationSets.DefaultAnimationSet() - MissionSelect:addEventHandler("button_action", function(f11_arg0, f11_arg1) - local f11_local0 = f11_arg1.controller or controllerIndex - ACTIONS.OpenMenu("SystemLinkMenu", true, f11_local0) - end) - MissionTeams:addEventHandler("button_action", function(f12_arg0, f12_arg1) - ACTIONS.OpenMenu("MissionTeamSelect", true, f12_arg1.controller or controllerIndex) - end) - f0_local0(self, controllerIndex, controller) - return self -end - -MenuBuilder.m_types["MissionsVerticalLayout"] = MissionsVerticalLayout diff --git a/data/cdata/ui_scripts/MainMenu/__init__.lua b/data/cdata/ui_scripts/MainMenu/__init__.lua index a3e8ffb6..b08178e6 100644 --- a/data/cdata/ui_scripts/MainMenu/__init__.lua +++ b/data/cdata/ui_scripts/MainMenu/__init__.lua @@ -1,10 +1,7 @@ if not Engine.InFrontend() then - return + return end -require("CampaignMenuButtons") -require("CPMainMenuButtons") require("CPMainMenu") -require("MissionsVerticalLayout") -require("MPMainMenuButtons") -require("MPMainMenu") +require("CPMPMainMenuButtons") +require("MissionButtons") diff --git a/src/client/resources/dw/playlists_tu23.aggr b/src/client/resources/dw/playlists_tu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