iw6-lui/lui/mp_menus/mplivepubliclobby.dec.lua
2024-09-12 17:25:45 +02:00

1456 lines
38 KiB
Lua

local f0_local0 = module
local f0_local1, f0_local2 = ...
f0_local0( f0_local1, package.seeall )
CoD.PrintModuleLoad( _NAME )
function CreateSquadAction( f1_arg0, f1_arg1 )
Cac.SetEditSquadMember( Cac.GetActiveSquadMember( f1_arg1.controller ) )
LUI.FlowManager.RequestAddMenu( f1_arg0, "cac_edit_main", true, f1_arg1.controller, false, {
open_char_list = true,
classLocation = "loadouts",
squadLocation = "squadMembers",
squadMemberIndex = Cac.GetEditSquadMember(),
allowMemberSwap = true
} )
end
function BarracksAction( f2_arg0, f2_arg1 )
if Engine.IsUserAGuest( f2_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f2_arg0, "popup_no_guest", true, f2_arg1.controller )
else
LUI.FlowManager.RequestAddMenu( f2_arg0, "menu_barracks", true, f2_arg1.controller )
end
end
function LobbyLeaderboardAction( f3_arg0, f3_arg1 )
if Engine.IsUserAGuest( f3_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f3_arg0, "popup_no_guest", true, f3_arg1.controller )
else
local f3_local0 = nil
if Engine.IsAliensMode() then
f3_local0 = Leaderboards.GetAlienCoopLeaderboardByMapName( Engine.GetDvarString( "ui_mapname" ) )
else
f3_local0 = Leaderboards.GetLeaderboardByGameType( Engine.GetDvarString( "ui_gametype" ) )
end
assert( f3_local0 ~= nil )
LUI.FlowManager.RequestPopupMenu( f3_arg0, "mp_leaderboard_main", true, f3_arg1.controller, false, {
leaderboardType = f3_local0,
filterType = "LobbyMembers",
isPublicLobbyLeaderboard = true
} )
end
end
function LivePublicLobbyMenuCreate( f4_arg0, f4_arg1 )
if SvS.IsSvS() then
LUI.FlowManager.RequestSetStack( f4_arg0, {
{
name = "mp_main_menu"
},
{
name = "squads_mode_select_menu"
},
{
name = "menu_xboxlive"
}
} )
else
LUI.FlowManager.RequestSetStack( f4_arg0, {
{
name = "mp_main_menu"
},
{
name = "menu_xboxlive"
}
} )
end
local f4_local0 = Engine.GetFirstActiveController()
f4_arg0:dispatchEventToRoot( {
name = "lobby_update_title",
immediate = true
} )
if SvS.GetCurrentSquadModeInfo() == SvS.SquadModes.SquadAssault then
f4_arg0:dispatchEventToRoot( {
name = "member_list_refresh",
dispatchChildren = true
} )
end
if Engine.GetDvarBool( "squad_match" ) and Engine.GetDvarBool( "squad_find_match" ) then
Squad.FindMatch( f4_local0 )
Engine.SetDvarBool( "squad_find_match", false )
if SvS.IsSvS() then
Engine.SetDvarInt( "pt_gameStartTimerLength", 10 )
end
end
if Engine.GetDvarBool( "squad_match" ) and Engine.GetDvarBool( "squad_send_results" ) then
SvS.CachePostMatchData( {
enemyName = Squad.GetEnemySquadOwnerName(),
enemySquadName = Squad.GetEnemySquadName(),
enemyPlayercard = {},
enemyPlayercard = 0,
enemyPlayercard = 0,
enemyPlayercard = 0,
enemyPlayercard = "",
enemyPlayercard = 0
} )
Engine.SetDvarBool( "squad_send_results", false )
end
if not Engine.IsAliensMode() then
for f4_local1 = 0, Engine.GetMaxControllerCount() - 1, 1 do
if Engine.HasActiveLocalClient( f4_local1 ) then
Cac.SyncPrestigeLevel( f4_local1 )
end
end
end
TryForceOpenAfterActionReport( f4_arg0, f4_arg1 )
if Engine.IsCoreMode() then
Engine.ExecNow( "eliteclan_refresh", f4_local0 )
end
Engine.ExecNow( "upload_playercard", f4_local0 )
Lobby.EnteredLobby()
f4_arg0:processEvent( {
name = "check_button_disable_status",
dispatchChildren = true
} )
f4_arg0:processEvent( {
name = "update_double_xp_icon"
} )
Cac.ValidateAllPlayersPublicSquadMembers()
end
function LivePublicLobbyMenuSpeechHandler( f5_arg0, f5_arg1 )
if Engine.HasSpeechFeature() then
LUI.Speech.ProcessActionEvent( f5_arg0, f5_arg1, Kinect.LobbySpeechGrammarHandlersArray )
end
end
function RequestExitPublicLobby( f6_arg0, f6_arg1 )
if Engine.HasSpeechFeature() and LUI.MenuAutoNav.IsRunning() then
LUI.mp_menus.mpLobbyWidgets.leaveLobbyAndPartyYesActionWithExitLobby( f6_arg0, f6_arg1 )
elseif IsOurPrivatePartyHostInLobby() then
LUI.FlowManager.RequestPopupMenu( f6_arg0, "leavelobbyandpartywarning", true, f6_arg1.controller, false, {} )
else
LUI.FlowManager.RequestPopupMenu( f6_arg0, "leavelobbywarning", true, f6_arg1.controller, false, {} )
end
end
function ExitPublicLobby( f7_arg0, f7_arg1 )
f7_arg0:dispatchEventToRoot( {
name = "exit_public_lobby"
} )
end
function VoteForMap( f8_arg0, f8_arg1, f8_arg2 )
local f8_local0 = assert
local f8_local1
if f8_arg2 ~= MapVoting.MapA.voteIndex and f8_arg2 ~= MapVoting.MapB.voteIndex then
f8_local1 = false
else
f8_local1 = true
end
f8_local0( f8_local1 )
if Engine.GetMilliseconds then
f8_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f8_arg0 )
if f8_local0.voteDelayEndTime and f8_local0.voteDelayEndTime > Engine.GetMilliseconds() then
f8_arg0:dispatchEventToRoot( {
name = "set_button_info_text",
text = Engine.Localize( "@PATCH_MENU_WAIT_TO_VOTE", f8_local0.voteCount or 1 )
} )
return
elseif not f8_local0.voteCount then
f8_local0.voteCount = 1
elseif f8_local0.voteCount < 6 then
f8_local0.voteCount = f8_local0.voteCount + 1
end
f8_local0.voteDelayEndTime = Engine.GetMilliseconds() + 1000 * f8_local0.voteCount
end
Engine.Exec( "xpartyvote " .. f8_arg2, f8_arg1 )
end
function GetLobbyLeaderboardStatus()
local f9_local0 = Engine.GetDvarString( "ui_gametype" )
local f9_local1 = Engine.GetDvarString( "ui_mapname" )
local f9_local2 = false
for f9_local6, f9_local7 in pairs( Leaderboards.Boards ) do
if Engine.IsAliensMode() then
if f9_local7.isAlienCoop and f9_local7.MapName and f9_local7.MapName == f9_local1 then
f9_local2 = true
break
end
end
if f9_local7.GameType and f9_local7.GameType == f9_local0 then
f9_local2 = true
break
end
end
return f9_local2 and Engine.GetDvarInt( "party_matchedPlayerCount" ) <= Engine.GetDvarInt( "party_partyPlayerCountNum" )
end
function CheckLobbyLeaderboardStatus( f10_arg0, f10_arg1 )
if GetLobbyLeaderboardStatus() then
f10_arg0:processEvent( {
name = "enable"
} )
else
f10_arg0:processEvent( {
name = "disable"
} )
end
end
function ReadyUpAction( f11_arg0, f11_arg1 )
if Lobby.UsingReadyUpFeature() and not Lobby.GetLocalReadyUpFlag() then
Lobby.SetLocalReadyUpFlag()
f11_arg0:dispatchEventToRoot( {
name = "refresh_ready_up"
} )
end
end
function GetReadyUpDisableValue()
if not Lobby.UsingReadyUpFeature() then
return true
elseif not Lobby.GetLocalReadyUpFlag() then
return false
else
return true
end
end
function GetReadyUpDisplayString( f13_arg0, f13_arg1 )
if Lobby.UsingReadyUpFeature() then
if not Lobby.GetLocalReadyUpFlag() then
return Engine.Localize( "@LUA_MENU_READY_UP_CAPS" )
end
local f13_local0 = Engine.GetDvarInt( "party_minplayers" )
local f13_local1 = Lobby.GetMemberCount( Lobby.MemberListStates.Lobby )
local f13_local2 = 0
for f13_local3 = 1, f13_local1, 1 do
if Lobby.IsActiveMemberSlot( f13_local3 - 1 ) then
f13_local2 = f13_local2 + 1
end
end
if f13_local2 < 1 then
return Engine.Localize( "@MENU_WAITING" )
end
local f13_local3 = f13_local0 - f13_local2
if f13_local3 == 1 then
return Engine.Localize( "@LUA_MENU_WAITING_FOR_1_MORE_PLAYER_CAPS" )
elseif f13_local3 > 1 then
return Engine.Localize( "@LUA_MENU_WAITING_FOR_MORE_PLAYERS_CAPS" )
elseif not Lobby.GetPartyReadyUpStatus() then
return Engine.Localize( "@LUA_MENU_WAITING_FOR_OTHER_PLAYERS_CAPS" )
end
return Engine.Localize( "@LUA_MENU_WAITING_FOR_GAME_TO_START_CAPS" )
else
return Engine.Localize( "@MENU_WAITING" )
end
end
function GetReadyUpDescText( f14_arg0, f14_arg1 )
if Lobby.UsingReadyUpFeature() then
if not Lobby.GetLocalReadyUpFlag() then
return Engine.Localize( "@LUA_MENU_DESC_READY_UP" )
elseif not Lobby.GetPartyReadyUpStatus() then
return Engine.Localize( "@LUA_MENU_DESC_WAITING_FOR_OTHER_PLAYERS" )
end
end
return Engine.Localize( "@LUA_MENU_DESC_LOCKED_WAITING_FOR_PARTY_MEMBERS" )
end
function UpdateReadyUpText( f15_arg0, f15_arg1 )
if GetReadyUpDisableValue( f15_arg0, f15_arg1 ) then
if not f15_arg0.disabled then
f15_arg0:processEvent( {
name = "disable"
} )
end
elseif f15_arg0.disabled then
f15_arg0:processEvent( {
name = "enable"
} )
end
f15_arg0:setText( GetReadyUpDisplayString( f15_arg0, f15_arg1 ) )
end
function RefreshButtonDisable( f16_arg0, f16_arg1 )
assert( f16_arg0.properties.disabledFunc )
local f16_local0 = f16_arg0.properties.disabledFunc()
if f16_local0 and not f16_arg0.disabled then
f16_arg0:processEvent( {
name = "disable"
} )
elseif not f16_local0 and f16_arg0.disabled then
f16_arg0:processEvent( {
name = "enable"
} )
end
end
function CheckSquadCompareDisabled()
return not Squad.FoundMatch()
end
function LivePublicLobbyOptionsFeeder( f18_arg0 )
local f18_local0 = Lobby.GetVoteMapName( MapVoting.MapA.refNum )
local f18_local1 = Lobby.GetVoteMapName( MapVoting.MapB.refNum )
local f18_local2 = Lobby.GetVoteMapImage( MapVoting.MapA.refNum )
local f18_local3 = Lobby.GetVoteMapImage( MapVoting.MapB.refNum )
local f18_local4 = LUI.mp_menus.Aliens.FixGameModeTextForChaos( Lobby.GetVoteMapGametype( MapVoting.MapA.refNum ) )
local f18_local5 = LUI.mp_menus.Aliens.FixGameModeTextForChaos( Lobby.GetVoteMapGametype( MapVoting.MapB.refNum ) )
local f18_local6 = IsVotingFinished()
local f18_local7 = not GetLobbyLeaderboardStatus()
local f18_local8 = Engine.IsAliensMode()
local f18_local9 = SvS.IsSvS()
if not f18_local9 then
f18_local9 = Engine.GetDvarBool( "squad_match" )
end
local f18_local10 = 14
local f18_local11 = {}
if not f18_arg0.slot then
DebugPrint( "[WARNING] CAC: using cac slot index 0, this is only ok if you are editing a menu" )
local f18_local12 = 0
end
local f18_local13 = Cac.GetCustomClassLoc( f18_arg0.classLocation )
if f18_local8 then
local f18_local14 = Engine.GetDvarInt( "pt_AliensReadyUpPublicInUse" )
if f18_local14 ~= nil and f18_local14 ~= 0 then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "ready_up_button_id",
disabledFunc = GetReadyUpDisableValue,
properties = {
disabledFunc = GetReadyUpDisableValue,
button_text = "",
button_action_func = ReadyUpAction,
desc_text = GetReadyUpDescText,
additional_handlers = {
recheck_start_button_lock = RefreshButtonDisable,
element_refresh = UpdateReadyUpText,
menu_create = UpdateReadyUpText,
ready_up_button_refresh = UpdateReadyUpText
}
},
children = {
{
type = "UITimer",
id = "ready_up_button_refresh_timer_id",
properties = {
event = "ready_up_button_refresh",
interval = 100,
disposable = false,
broadcastToRoot = false
}
}
}
}
end
end
if not f18_local8 then
if not SvS.IsSvS() or SvS.GetCurrentSquadModeInfo() ~= SvS.SquadModes.SquadAssault then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "create_squad_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_CREATE_A_CLASS_CAPS" ),
button_action_func = CreateSquadAction,
desc_text = Engine.Localize( "@LUA_MENU_DESC_CREATE_A_CLASS" )
}
}
end
else
f18_local11[#f18_local11 + 1] = LUI.mp_menus.AliensLoadout.GetAliensLoadoutButton()
end
if not f18_local8 and not f18_local9 then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "operations_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_OPERATIONS_TITLE" ),
button_action_func = LUI.mp_menus.MPBarracks.BarrackOperationsAction,
desc_text = Engine.Localize( "@LUA_MENU_DESC_CHALLENGES" )
}
}
end
if not f18_local9 and not f18_local8 then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "barracks_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_BARRACKS_CAPS" ),
button_action_func = BarracksAction,
desc_text = Clan.IsEnabled() and Engine.Localize( "@LUA_MENU_DESC_BARRACKS" ) or Engine.Localize( "@LUA_MENU_DESC_BARRACKS_PRIVATE" )
}
}
end
if not f18_local9 then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "lobby_leaderboard_button_id",
disabled = f18_local7,
properties = {
button_text = Engine.Localize( "@LUA_MENU_LOBBY_LEADERBOARD" ),
button_action_func = LobbyLeaderboardAction,
desc_text = Engine.Localize( "@LUA_MENU_DESC_LOBBY_LEADERBOARDS" ),
additional_handlers = {
check_button_disable_status = CheckLobbyLeaderboardStatus
}
}
}
end
if f18_local9 then
local f18_local14 = SvS.GetCurrentSquadModeInfo()
if f18_local14 and f18_local14.HasReports then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "squad_reports_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_SQUAD_REPORTS" ),
desc_text = Engine.Localize( "@LUA_MENU_SQUAD_REPORTS_DESC" ),
button_action_func = function ( f19_arg0, f19_arg1 )
LUI.FlowManager.RequestAddMenu( f19_arg0, "squad_reports_menu", false, f19_arg1.controller, false, {
controller = f19_arg1.controller,
fromLiveLobby = true
} )
end
}
}
end
if f18_local14 and f18_local14.HasCompare then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "squad_compare_button_id",
disabled = CheckSquadCompareDisabled(),
properties = {
button_text = Engine.Localize( "@LUA_MENU_SQUAD_COMPARE" ),
desc_text = Engine.Localize( "@LUA_MENU_SQUAD_COMPARE_DESC" ),
button_action_func = function ( f20_arg0, f20_arg1 )
if Squad.FoundMatch() then
local f20_local0 = SvS.BuildSquadCompareData( f20_arg1.controller )
if f20_local0 then
LUI.FlowManager.RequestAddMenu( f20_arg0, "squad_report_detail_menu", false, f20_arg1.controller, false, {
reportData = f20_local0,
controller = f20_arg1.controller,
isCompare = true
} )
end
end
end
},
handlers = {
check_button_disable_status = function ( f21_arg0, f21_arg1 )
local f21_local0 = f21_arg0
local f21_local1 = f21_arg0.processEvent
local f21_local2 = {}
local f21_local3
if not CheckSquadCompareDisabled() then
f21_local3 = "enable"
if not f21_local3 then
else
f21_local2.name = f21_local3
f21_local1( f21_local0, f21_local2 )
end
end
f21_local3 = "disable"
end
}
}
end
end
if f18_local9 then
local f18_local14 = SvS.GetCurrentSquadModeInfo()
if not f18_local14.HasLeaderboard then
else
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "leaderboards_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_LEADERBOARDS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_LEADERBOARDS" ),
button_action_func = function ( f22_arg0, f22_arg1 )
if Engine.IsUserAGuest( f22_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f22_arg0, "popup_no_guest", true, f22_arg1.controller )
else
LUI.FlowManager.RequestAddMenu( f22_arg0, "leaderboards", true, f22_arg1.controller )
end
end
}
}
end
end
if f18_local8 then
f18_local11[#f18_local11 + 1] = {
type = "UIGenericButton",
id = "leaderboards_button_id",
properties = {
button_text = Engine.Localize( "@LUA_MENU_LEADERBOARDS_CAPS" ),
desc_text = Engine.Localize( "@LUA_MENU_DESC_LEADERBOARDS" ),
button_action_func = function ( f22_arg0, f22_arg1 )
if Engine.IsUserAGuest( f22_arg1.controller ) then
LUI.FlowManager.RequestPopupMenu( f22_arg0, "popup_no_guest", true, f22_arg1.controller )
else
LUI.FlowManager.RequestAddMenu( f22_arg0, "leaderboards", true, f22_arg1.controller )
end
end
}
}
end
if f18_local8 and LUI.mp_menus.Aliens.CanAccessIntelMenu() then
f18_local11[#f18_local11 + 1] = LUI.mp_menus.AliensIntel.GetAliensIntelButton()
end
f18_local11[#f18_local11 + 1] = {
type = "button_desc_text",
id = "public_lobby_description_id",
properties = {
lines = 1
}
}
f18_local11[#f18_local11 + 1] = {
type = "UIElement",
id = "just_a_spacer_id",
focusable = false,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = f18_local10
}
}
}
f18_local11[#f18_local11 + 1] = {
type = "UITimer",
id = "check_status_tmr",
properties = {
event = "check_button_disable_status",
interval = 500,
disposable = false,
broadcastToRoot = true
}
}
if not f18_local9 and not f18_local6 then
f18_local11[#f18_local11 + 1] = {
type = "map_button",
id = "map_button_1",
properties = {
mapVoteIndex = MapVoting.MapA.refNum,
mapImage = RegisterMaterial( f18_local2 ),
mapName = f18_local0,
gamemode = f18_local4,
votesText = Engine.GetDvarString( "party_nextMapVoteStatus" ),
votesDvarName = "party_nextMapVoteStatus",
action = function ( f23_arg0, f23_arg1 )
VoteForMap( f23_arg0, f23_arg1.controller, MapVoting.MapA.voteIndex )
end
}
}
f18_local11[#f18_local11 + 1] = {
type = "UIElement",
id = "just_another_spacer_id",
focusable = false,
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = 0,
bottom = 40
}
}
}
f18_local11[#f18_local11 + 1] = {
type = "map_button",
id = "map_button_2",
properties = {
mapVoteIndex = MapVoting.MapB.refNum,
mapImage = RegisterMaterial( f18_local3 ),
mapName = f18_local1,
gamemode = f18_local5,
votesText = Engine.GetDvarString( "party_alternateMapVoteStatus" ),
votesDvarName = "party_alternateMapVoteStatus",
action = function ( f24_arg0, f24_arg1 )
VoteForMap( f24_arg0, f24_arg1.controller, MapVoting.MapB.voteIndex )
end
}
}
end
return f18_local11
end
function UpdatePlaylistTitleText( f25_arg0, f25_arg1 )
local f25_local0 = Engine.GetDvarString( "playlist_name" )
if f25_local0 then
f25_arg0:processEvent( {
name = "update_header_text",
string = f25_local0
} )
end
end
function HandleTransitionToGame( f26_arg0, f26_arg1 )
if not Lobby.SafeToStartLobbyTransition then
return
end
local f26_local0, f26_local1 = Lobby.GetPartyStatus()
if f26_local1 and f26_local1 > 0 and f26_local1 <= 1 and f26_arg0.properties.transitionToGameStarted == false and Lobby.SafeToStartLobbyTransition() then
f26_arg0.properties.transitionToGameStarted = true
f26_arg0:processEvent( {
name = "lose_focus"
} )
LUI.UIRoot.BlockButtonInput( Engine.GetLuiRoot(), true, "MenuTransition" )
f26_arg0:dispatchEventToRoot( {
name = "lobby_transition_to_game",
dispatchChildren = true,
immediate = true
} )
end
if f26_local1 == -1 and f26_arg0.properties.transitionToGameStarted then
f26_arg0:processEvent( {
name = "gain_focus"
} )
LUI.UIRoot.BlockButtonInput( Engine.GetLuiRoot(), false, "MenuTransition" )
f26_arg0.properties.transitionToGameStarted = false
f26_arg0:dispatchEventToRoot( {
name = "lobby_rollback_transition_to_game",
dispatchChildren = true,
immediate = true
} )
end
end
function menu_xboxlive_lobby()
local f27_local0 = Engine.IsAliensMode()
local f27_local1
if SvS.IsSvS() ~= false then
f27_local1 = SvS.ShouldDisplayAAR()
else
f27_local1 = true
end
local f27_local2 = nil
if f27_local1 then
f27_local2 = OpenAfterActionReport
end
return {
type = "UIElement",
id = "menu_xboxlive_publiclobby_root",
properties = {
transitionToGameStarted = false
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 0,
right = 0
}
},
handlers = {
menu_create = LivePublicLobbyMenuCreate,
speech_action = LivePublicLobbyMenuSpeechHandler,
exit_public_lobby = MBh.LeaveMenu(),
open_after_action_report = OpenAfterActionReport,
check_transition_to_game = HandleTransitionToGame
},
children = {
{
type = "UITimer",
id = "check_transition_to_game_id",
properties = {
event = "check_transition_to_game",
interval = 100,
disposable = false
}
},
{
type = "lobby_navigation",
properties = {
lobbyNavigationPages = PublicLobbyNavigationPages
}
},
{
type = "UITimer",
id = "options_list_tmr",
properties = {
event = "check_refresh_lobby_options",
interval = 500,
disposable = false,
broadcastToRoot = true
}
},
{
type = "UIBindButton",
id = "lobby_bind_buttons_id",
handlers = {
button_secondary = RequestExitPublicLobby,
button_select = f27_local2
}
},
{
type = "lobby_loading_widget"
},
{
type = "lobby_game_type_title"
},
{
type = "lobby_game_type_icon",
properties = {
online = true
}
},
{
type = "aar_mini",
id = "the_mini_aar_id"
},
{
type = "UIElement",
id = "LowerSliderID",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0,
alpha = 1
},
hidden = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 100,
bottom = 100,
alpha = 0
}
},
handlers = {
lobby_transition_to_game = MBh.AnimateToState( "hidden", Lobby.TransitionTime ),
lobby_rollback_transition_to_game = MBh.AnimateToState( "default", Lobby.TransitionTime ),
menu_create = function ( f28_arg0, f28_arg1 )
f28_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
if f27_local1 then
f28_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addGameSummaryButton )
end
end
,
refresh_player_count = function ( f29_arg0, f29_arg1 )
if not SvS.IsSvS() then
local f29_local0 = Engine.GetDvarString( "party_lobbyPlayerCount" )
local f29_local1 = f29_arg0:getParent()
f29_local1:processEvent( {
name = "add_button_helper_text",
button_ref = "players",
helper_text = f29_local0,
side = "right",
clickable = false
} )
end
end
},
children = {
{
type = "map_info_text",
id = "map_info_text_id"
},
{
type = "lobby_status",
id = "lobby_status_id"
},
{
type = "lobby_search_status",
id = "lobby_search_status_id"
},
{
type = "character_playing_as",
id = "character_playing_as_id"
},
{
type = "SocialFeedTicker",
id = "social_ticker_id",
properties = {
isLobbyTicker = true
}
},
{
type = "button_helper_text_main",
id = "cac_button_helper_text_id"
},
{
type = "online_friends_widget",
id = "online_friends_widget_id"
},
{
type = "UITimer",
id = "player_count_timer",
properties = {
event = "refresh_player_count",
interval = 200,
disposable = false
}
}
}
}
}
}
end
function menu_xboxlive_lobby_push()
if Engine.IsAliensMode() then
Lobby.ClearLocalReadyUpFlag()
end
end
function PublicLobbyNavigationPages( f31_arg0 )
local f31_local0 = {}
local f31_local1 = 25
local f31_local2 = GenericMenuDims.menu_top
if SvS.IsSvS() and SvS.GetCurrentSquadModeInfo() == SvS.SquadModes.SquadAssault then
f31_local2 = GenericMenuDims.menu_top - 20
end
f31_local0[#f31_local0 + 1] = {
title = "Playlist Name",
title_update_func = UpdatePlaylistTitleText,
element = {
type = "UIElement",
id = "live_public_lobby_options_container",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
children = {
getXPIcon(),
{
type = "live_public_lobby_options",
id = "live_public_lobby_options_id",
properties = {
additional_handlers = {
refresh_ready_up = MBh.EmitEvent( "menu_refresh" )
}
},
childrenFeeder = LivePublicLobbyOptionsFeeder
}
}
}
}
f31_local0[#f31_local0 + 1] = {
title = Engine.Localize( "@LUA_MENU_LOBBY_LIST_CAPS" ),
element = {
type = "UIElement",
id = "members_page",
properties = {
additional_handlers = {
lobby_page_left = function ( f32_arg0, f32_arg1 )
f32_arg0:animateToState( "page_left", f32_arg1.animTime or 0, true )
end,
lobby_page_right = function ( f33_arg0, f33_arg1 )
f33_arg0:animateToState( "page_right", f33_arg1.animTime or 0, true )
end
}
},
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 550,
top = 0,
bottom = 0
},
page_left = {
leftAnchor = false,
rightAnchor = true,
left = -550,
right = 0
},
page_right = {
leftAnchor = true,
rightAnchor = false,
left = 0,
right = 550
}
},
children = {
{
type = "lobby_search_widget",
id = "public_lobby_search_widget"
},
{
type = "member_list",
properties = {
memberListState = Lobby.MemberListStates.Lobby,
isPublicLobby = true,
delayMemberList = SvS.GetCurrentSquadModeInfo() == SvS.SquadModes.SquadAssault
},
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = 0,
top = f31_local2,
bottom = GenericMenuDims.menu_bottom + f31_local1,
spacing = GetMemberListSpacing()
}
}
}
}
}
}
if not Engine.IsAliensMode() or Engine.GetDvarBool( "extinction_cac_enabled" ) then
f31_local0[#f31_local0 + 1] = {
title = Engine.Localize( "@LUA_MENU_PLAYER_STATS_CAPS" ),
element = {
type = "lobby_character_view",
id = "lobby_character_view_id",
properties = {
squad_location = "squadMembers"
}
}
}
end
f31_local0[#f31_local0 + 1] = {
title = Engine.Localize( "@LUA_MENU_PLAYER_COMPARISON_CAPS" ),
element = {
type = "lobby_player_stats",
id = "lobby_player_stats_id",
properties = {
additional_handlers = {
lobby_page_left = function ( f34_arg0, f34_arg1 )
f34_arg0:animateToState( "page_left", f34_arg1.animTime or 0, true )
end,
lobby_page_right = function ( f35_arg0, f35_arg1 )
f35_arg0:animateToState( "page_right", f35_arg1.animTime or 0, true )
end
}
},
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 550,
top = 0,
bottom = 0
},
page_left = {
leftAnchor = false,
rightAnchor = true,
left = -550,
right = 0
},
page_right = {
leftAnchor = true,
rightAnchor = false,
left = 0,
right = 550
}
}
}
}
if not Engine.IsAliensMode() or Engine.GetDvarBool( "extinction_cac_enabled" ) then
f31_local0[#f31_local0 + 1] = {
element = {
type = "lobby_player_stats",
id = "lobby_player_comparison_id",
properties = {
isComparison = true,
additional_handlers = {
lobby_page_left = function ( f36_arg0, f36_arg1 )
f36_arg0:animateToState( "page_left", f36_arg1.animTime or 0, true )
end,
lobby_page_right = function ( f37_arg0, f37_arg1 )
f37_arg0:animateToState( "page_right", f37_arg1.animTime or 0, true )
end
}
},
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 550,
top = 0,
bottom = 0
},
page_left = {
leftAnchor = false,
rightAnchor = true,
left = -550,
right = 0
},
page_right = {
leftAnchor = true,
rightAnchor = false,
left = 0,
right = 550
}
}
}
}
end
return f31_local0
end
function checkRefreshLobbyOptions( f38_arg0, f38_arg1 )
local f38_local0 = false
local f38_local1 = IsVotingFinished()
local f38_local2 = Lobby.GetHostName()
if f38_arg0.properties.map_voting_complete ~= f38_local1 then
f38_arg0.properties.map_voting_complete = f38_local1
f38_local0 = true
end
if f38_arg0.properties.hostname ~= f38_local2 then
f38_arg0.properties.hostname = f38_local2
f38_local0 = true
end
if f38_local0 then
f38_arg0:processEvent( {
name = "menu_refresh"
} )
end
end
function CreateLobbyOptions( f39_arg0, f39_arg1 )
f39_arg0.properties.hostname = Lobby.GetHostName()
end
function live_public_lobby_options()
return {
type = "UIVerticalList",
id = "live_public_lobby_options_list_id",
focusable = true,
states = {
default = {
alignment = LUI.Alignment.Top,
leftAnchor = true,
rightAnchor = false,
topAnchor = true,
bottomAnchor = false,
left = GenericMenuDims.menu_left,
right = GenericMenuDims.menu_right_more,
top = GenericMenuDims.menu_top,
bottom = GenericMenuDims.menu_bottom_tall
}
},
handlers = {
menu_create = CreateLobbyOptions,
check_refresh_lobby_options = checkRefreshLobbyOptions
}
}
end
function UpdateVotesText( f41_arg0, f41_arg1 )
if f41_arg0.properties.votesDvarName ~= "" then
f41_arg0:setText( Engine.GetDvarString( f41_arg0.properties.votesDvarName ) )
end
end
function UpdateMyMapImage( f42_arg0, f42_arg1 )
local f42_local0 = Lobby.GetVoteMapImage( f42_arg0.properties.mapVoteIndex )
if f42_local0 then
f42_arg0:setImage( RegisterMaterial( f42_local0 ) )
end
end
function UpdateMapNameText( f43_arg0, f43_arg1 )
local f43_local0 = Lobby.GetVoteMapName( f43_arg0.properties.mapVoteIndex )
if f43_local0 then
f43_arg0:setText( f43_local0 )
end
end
function UpdateGameTypeText( f44_arg0, f44_arg1 )
local f44_local0 = Lobby.GetVoteMapGametype( f44_arg0.properties.mapVoteIndex )
if f44_local0 then
f44_arg0:setText( LUI.mp_menus.Aliens.FixGameModeTextForChaos( f44_local0 ) )
end
end
function MapButtonRefreshAll( f45_arg0, f45_arg1 )
f45_arg0:processEvent( {
name = "map_button_refresh_all"
} )
end
function ExtendMapPanel( f46_arg0, f46_arg1 )
local f46_local0 = f46_arg0:getParent()
f46_local0:dispatchEventToChildren( {
name = "expand"
} )
f46_local0:dispatchEventToChildren( {
name = "updateBorderColor",
red = Colors.grey_3.r,
green = Colors.grey_3.g,
blue = Colors.grey_3.b,
alpha = 1
} )
end
function ContractMapPanel( f47_arg0, f47_arg1 )
local f47_local0 = f47_arg0:getParent()
f47_local0:dispatchEventToChildren( {
name = "contract"
} )
f47_local0:dispatchEventToChildren( {
name = "updateBorderColor",
red = Colors.grey_2.r,
green = Colors.grey_2.g,
blue = Colors.grey_2.b,
alpha = 1
} )
end
function map_button()
local f48_local0 = Engine.IsAliensMode() and 80 or 114
local f48_local1 = Engine.IsAliensMode() and 130 or 0
return {
type = "UIElement",
focusable = true,
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = 0,
left = 0,
right = -34,
bottom = f48_local0
}
},
properties = {
mapVoteIndex = -1,
mapImage = RegisterMaterial( "" ),
mapName = "",
gamemode = "",
votesText = "",
votesDvarName = "",
action = function ()
DebugPrint( "OverrideMe" )
end
},
handlers = {
map_info_refresh = MapButtonRefreshAll
},
children = {
{
type = "UITimer",
id = "map_button_timer",
properties = {
event = "map_info_refresh",
interval = 200,
disposable = false
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Colors.black, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
width = 100,
material = RegisterMaterial( "white" )
} )
}
},
{
type = "UIImage",
id = "map_image_shadow",
states = {
default = {
material = RegisterMaterial( "img_lobby_map_shadow" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 40,
top = -30,
bottom = 70
},
focused = {
material = RegisterMaterial( "img_lobby_map_shadow" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 70,
top = -30,
bottom = 70
}
},
handlers = {
expand = MBh.AnimateToState( "focused", 100 ),
contract = MBh.AnimateToState( "default", 0 )
}
},
{
type = "UIButton",
id = "map_panel_container",
properties = {
action = MBh.Property( "action" ),
mapImage = MBh.Property( "mapImage" ),
mapVoteIndex = MBh.Property( "mapVoteIndex" ),
votesDvarName = MBh.Property( "votesDvarName" ),
votesText = MBh.Property( "votesText" )
},
states = {
default = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = -12,
right = -12
},
focused = {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = true,
top = 0,
bottom = 0,
left = 28,
right = 28
}
},
handlers = {
expand = MBh.AnimateToState( "focused", 100 ),
contract = MBh.AnimateToState( "default", 0 ),
button_action = function ( f50_arg0, f50_arg1 )
f50_arg0.properties:action( f50_arg1 )
end
},
children = {
{
type = "UIStencil",
id = "map_stencil_id",
states = {
default = {
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0,
bottom = 0
}
},
children = {
{
type = "UIImage",
id = "map_image_id",
states = {
default = {
material = MBh.Property( "mapImage" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = true,
left = 0,
right = 0,
top = 0 - f48_local1,
bottom = 0 + f48_local1
}
},
handlers = {
map_button_refresh_all = UpdateMyMapImage,
element_refresh = UpdateMyMapImage
}
}
}
},
{
type = "UIImage",
id = "map_text_darken",
states = {
default = {
material = RegisterMaterial( "img_map_darken" ),
leftAnchor = true,
rightAnchor = true,
topAnchor = false,
bottomAnchor = true,
left = 1,
right = -1,
top = -40,
bottom = -1 * f48_local0,
alpha = 0.75
}
}
},
{
type = "UIText",
id = "gamemode_name_text_id",
properties = {
text = "",
textStyle = CoD.TextStyle.Shadowed,
mapVoteIndex = MBh.Property( "mapVoteIndex" )
},
states = {
default = {
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = -10,
top = 3,
bottom = 3 + CoD.TextSettings.NormalFont.Height,
red = 0.5,
green = 0.5,
blue = 0.5
}
},
handlers = {
map_button_refresh_all = UpdateGameTypeText,
element_refresh = UpdateGameTypeText
}
},
{
type = "UIText",
id = "num_votes_text_id",
properties = {
text = "",
textStyle = CoD.TextStyle.Shadowed,
votesDvarName = MBh.Property( "votesDvarName" )
},
states = {
default = {
alignment = LUI.Alignment.Right,
font = CoD.TextSettings.NormalFont.Font,
leftAnchor = true,
rightAnchor = true,
topAnchor = true,
bottomAnchor = false,
left = 0,
right = -10,
top = 20,
bottom = 20 + CoD.TextSettings.NormalFont.Height
}
},
handlers = {
map_button_refresh_all = UpdateVotesText,
element_refresh = UpdateVotesText
}
},
{
type = "generic_border",
id = "boarder_image_id",
properties = {
inner = true,
thickness = 2,
border_red = Colors.grey_2.r,
border_green = Colors.grey_2.g,
border_blue = Colors.grey_2.b,
border_alpha = 1
}
},
{
type = "UIImage",
states = {
default = CoD.ColorizeState( Colors.black, {
topAnchor = true,
bottomAnchor = true,
leftAnchor = true,
rightAnchor = false,
top = 0,
bottom = 0,
left = 0,
width = 100,
material = RegisterMaterial( "box_white_gradient_fade" )
} )
}
}
}
},
{
type = "UIGenericButton",
id = "map_button",
properties = {
button_text = MBh.Property( "mapName" ),
desc_text = Engine.Localize( "@LUA_MENU_VOTE_FOR_MAP" ),
action = MBh.Property( "action" ),
mapVoteIndex = MBh.Property( "mapVoteIndex" ),
button_over_func = ExtendMapPanel,
button_up_func = ContractMapPanel
},
states = {
default = {
topAnchor = true,
bottomAnchor = false,
leftAnchor = true,
rightAnchor = true,
top = f48_local0 - 1,
bottom = f48_local0 - 1 + GenericButtonSettings.Styles.GradientButton.height,
left = 0,
right = -5
}
},
handlers = {
button_action = function ( f51_arg0, f51_arg1 )
f51_arg0.properties:action( f51_arg1 )
end
,
map_button_refresh_all = UpdateMapNameText
}
}
}
}
end
LUI.MenuBuilder.registerDef( "map_button", map_button )
LUI.MenuBuilder.registerDef( "menu_xboxlive_lobby", menu_xboxlive_lobby )
LUI.FlowManager.RegisterStackPushBehaviour( "menu_xboxlive_lobby", menu_xboxlive_lobby_push )
LUI.MenuBuilder.registerDef( "live_public_lobby_options", live_public_lobby_options )
LockTable( _M )