From 6668869b7de5bee2c7ad7c6cc6bfa337617b02c4 Mon Sep 17 00:00:00 2001 From: WantedDV <122710241+WantedDV@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:44:59 -0230 Subject: [PATCH] Fix Mapvote resetting lobby - sets the map then wait for player to start game - correctly sets the voted map --- data/ui_scripts/frontend_menus/__init__.lua | 19 ++++++++++++------- data/ui_scripts/playlist/__init__.lua | 10 ++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 data/ui_scripts/playlist/__init__.lua diff --git a/data/ui_scripts/frontend_menus/__init__.lua b/data/ui_scripts/frontend_menus/__init__.lua index 1b2d3abe..169d50ab 100644 --- a/data/ui_scripts/frontend_menus/__init__.lua +++ b/data/ui_scripts/frontend_menus/__init__.lua @@ -2,6 +2,8 @@ if Engine.GetCurrentMap() ~= "core_frontend" then return end +local EnableLobbyMapVote = true -- toggle map vote in public lobby + local utils = require("utils") require("DataSources_StartMenuTabs") @@ -51,7 +53,13 @@ CoD.LobbyButtons.MP_CUSTOM_SETUP_GAME = { customId = "btnSetupGame", } -local shouldShowMapVote = false +local LobbyMapVoteIsEnabled = EnableLobbyMapVote +local LobbyMapVote = function( LobbyMapVoteIsEnabled ) + if LobbyMapVoteIsEnabled == true then + Engine.Exec( nil, "LobbyStopDemo" ) + end +end + local addCustomButtons = function(controller, menuId, buttonTable, isLeader) if menuId == LobbyData.UITargets.UI_MPLOBBYONLINE.id or menuId == LobbyData.UITargets.UI_ZMLOBBYONLINE.id then utils.AddSpacer(buttonTable) @@ -63,13 +71,10 @@ local addCustomButtons = function(controller, menuId, buttonTable, isLeader) end if menuId == LobbyData.UITargets.UI_MPLOBBYONLINE.id then - shouldShowMapVote = true + LobbyMapVoteIsEnabled = EnableLobbyMapVote elseif menuId == LobbyData.UITargets.UI_MPLOBBYONLINEPUBLICGAME.id then - if shouldShowMapVote == true then - shouldShowMapVote = false - --Enable map vote at start lobby - Engine.Exec(nil, "LobbyStopDemo") - end + LobbyMapVote( LobbyMapVoteIsEnabled ) + LobbyMapVoteIsEnabled = false utils.AddLargeButton(controller, buttonTable, CoD.LobbyButtons.MP_START_GAME, 1) --Launch match button utils.AddSpacer(buttonTable, 1) diff --git a/data/ui_scripts/playlist/__init__.lua b/data/ui_scripts/playlist/__init__.lua new file mode 100644 index 00000000..091a726c --- /dev/null +++ b/data/ui_scripts/playlist/__init__.lua @@ -0,0 +1,10 @@ +if Engine.GetCurrentMap() ~= "core_frontend" then + return +end + +Engine.SetDvar( "lobbyMigrate_Enabled", 0 ) +Engine.SetDvar( "lobbyTimerStatusVotingInterval", 11000 ) +Engine.SetDvar( "lobbyTimerStatusBeginInterval", 10 ) +Engine.SetDvar( "lobbyTimerStatusStartInterval", 10 ) +Engine.SetDvar( "lobbyTimerStatusPostGameInterval", 10 ) +Engine.SetDvar( "lobbyTimerStatusVotingInterval_Arena", 11000 )