1110 lines
31 KiB
Lua
1110 lines
31 KiB
Lua
local f0_local0 = module
|
|
local f0_local1, f0_local2 = ...
|
|
f0_local0( f0_local1, package.seeall )
|
|
CoD.PrintModuleLoad( _NAME )
|
|
function CheckHasRequiredDLC( f1_arg0 )
|
|
if Engine.GetDvarInt( "req_cpdlc" ) == 1 and Engine.IsXbox360() and not Engine.AnyoneHasRequiredDLC() then
|
|
if not Engine.AnyoneDownloadingRequiredDLC() then
|
|
LUI.FlowManager.RequestPopupMenu( f1_arg0, "need_to_download_required_dlc" )
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( f1_arg0, "currently_downloading_required_dlc" )
|
|
end
|
|
return false
|
|
else
|
|
return true
|
|
end
|
|
end
|
|
|
|
f0_local0 = false
|
|
function DisplayLowRepWarning( f2_arg0, f2_arg1 )
|
|
if not f0_local0 and Engine.AnyoneHasBadReputation() then
|
|
f0_local0 = true
|
|
LUI.FlowManager.RequestPopupMenu( f2_arg0, "generic_confirmation_popup", false, f2_arg1.controller, false, {
|
|
popup_title = Engine.Localize( "MENU_WARNING" ),
|
|
message_text = Engine.Localize( "LUA_MENU_MP_X1_LOW_REP_WARNING" ),
|
|
button_text = Engine.Localize( "MENU_OK" ),
|
|
confirmation_action = function ( f3_arg0, f3_arg1 )
|
|
FindMatchAfterThrottleEvent( f3_arg0, f2_arg1 )
|
|
end
|
|
} )
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function FindMatchAfterThrottleEvent( f4_arg0, f4_arg1 )
|
|
local f4_local0 = false
|
|
local f4_local1 = -1
|
|
for f4_local2 = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
|
if Engine.HasActiveLocalClient( f4_local2 ) and IsFirstTimeFlowRequired( f4_local2 ) then
|
|
f4_local0 = true
|
|
if f4_local1 < 0 then
|
|
f4_local1 = f4_local2
|
|
end
|
|
end
|
|
end
|
|
if f4_local0 then
|
|
LUI.FlowManager.RequestAddMenu( f4_arg0, "cac_member_select_main", true, f4_local1, false, {
|
|
next_screen = "cac_edit_main",
|
|
squad_location = "squadMembers",
|
|
class_location = "loadouts",
|
|
findMatch = true
|
|
} )
|
|
elseif not disableCreateGameButtons() then
|
|
Engine.Exec( "xblive_privatematch 0" )
|
|
if Engine.IsAliensMode() then
|
|
LUI.mp_menus.Aliens.AliensRunConfig( f4_arg1.controller )
|
|
end
|
|
if CheckHasRequiredDLC( f4_arg0 ) then
|
|
if DisplayLowRepWarning( f4_arg0, f4_arg1 ) then
|
|
return
|
|
elseif SvS.IsSvS() then
|
|
local f4_local3 = SvS.GetCurrentSquadModeInfo()
|
|
local f4_local4, f4_local5 = SvS.GetPlaylistFromSquadMode( f4_local3 )
|
|
local f4_local6 = false
|
|
if f4_arg1.squadsPlayNow then
|
|
f4_local6 = true
|
|
end
|
|
if not f4_arg1.squadsPlayNow and f4_local3.DynamicMatchmaking then
|
|
Playlist.DoAction( f4_local4, f4_local5, true, f4_local6 )
|
|
else
|
|
Playlist.DoAction( f4_local4, f4_local5, false, f4_local6 )
|
|
end
|
|
if Engine.GetDvarBool( "squad_match" ) then
|
|
Squad.StartMatch( f4_arg1.controller, true )
|
|
Engine.SetDvarBool( "squad_find_match", true )
|
|
end
|
|
LUI.FlowManager.RequestAddMenu( f4_arg0, "menu_xboxlive_lobby", false, f4_arg1.controller, false )
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( f4_arg0, "playlist_main" )
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
function FindMatchAction( f5_arg0, f5_arg1 )
|
|
if Lobby.EnteringLobby() == true then
|
|
LUI.FlowManager.RequestPopupMenu( f5_arg0, "popup_throttling", true, f5_arg1.controller, false, {
|
|
eventData = f5_arg1
|
|
} )
|
|
else
|
|
FindMatchAfterThrottleEvent( f5_arg0, f5_arg1 )
|
|
end
|
|
end
|
|
|
|
function SoloMatchAction( f6_arg0, f6_arg1 )
|
|
if not shouldDisableSoloMatch() then
|
|
Engine.Exec( MPConfig.default_xboxlive, f6_arg1.controller )
|
|
Engine.Exec( "ui_enumeratesaved", f6_arg1.controller )
|
|
Engine.Exec( "xblive_privatematch 1" )
|
|
SetIsAliensSolo( true )
|
|
Engine.SetDvarInt( "party_maxplayers", 1 )
|
|
Engine.Exec( "xstartprivatematch" )
|
|
LUI.FlowManager.RequestAddMenu( f6_arg0, "menu_xboxlive_privatelobby", false, f6_arg1.controller, false, {} )
|
|
end
|
|
end
|
|
|
|
function PrivateMatchAction( f7_arg0, f7_arg1 )
|
|
if not disableCreateGameButtons() then
|
|
Engine.Exec( MPConfig.default_xboxlive, f7_arg1.controller )
|
|
Engine.Exec( "ui_enumeratesaved", f7_arg1.controller )
|
|
Engine.Exec( "xblive_privatematch 1" )
|
|
SetIsAliensSolo( false )
|
|
Engine.Exec( "xstartprivatematch" )
|
|
LUI.FlowManager.RequestAddMenu( f7_arg0, "menu_xboxlive_privatelobby", false, f7_arg1.controller, false, {} )
|
|
end
|
|
end
|
|
|
|
function CreateSquadAction( f8_arg0, f8_arg1 )
|
|
Cac.ValidateAllPlayersPublicSquadMembers()
|
|
LUI.FlowManager.RequestAddMenu( f8_arg0, "cac_member_select_main", true, f8_arg1.controller, false, {
|
|
next_screen = "cac_edit_main",
|
|
squad_location = "squadMembers",
|
|
class_location = "loadouts"
|
|
} )
|
|
end
|
|
|
|
function BarracksAction( f9_arg0, f9_arg1 )
|
|
if Engine.IsUserAGuest( f9_arg1.controller ) then
|
|
LUI.FlowManager.RequestPopupMenu( f9_arg0, "popup_no_guest", true, f9_arg1.controller )
|
|
else
|
|
LUI.FlowManager.RequestAddMenu( f9_arg0, "menu_barracks", true, f9_arg1.controller )
|
|
end
|
|
end
|
|
|
|
function storeButtonAction( f10_arg0, f10_arg1 )
|
|
Sns.OpenStoreMenu( f10_arg1.controller )
|
|
end
|
|
|
|
function LiveMenuCoDAnywhereAction( f11_arg0, f11_arg1 )
|
|
if Engine.GetDvarInt( "ca_intra_only" ) == 1 then
|
|
if CoDAnywhere.ShouldShowLinkCreatePopup( f11_arg1.controller, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( f11_arg0, "cod_anywhere_popup_menu", true, f11_arg1.controller )
|
|
else
|
|
LUI.FlowManager.RequestPopupMenu( f11_arg0, "cod_anywhere_all_done_popup_menu", true, f11_arg1.controller )
|
|
end
|
|
elseif CoDAnywhere.ShouldShowLinkCreatePopup( f11_arg1.controller, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( f11_arg0, "cod_anywhere_popup_menu", true, f11_arg1.controller )
|
|
elseif CoDAnywhere.ShouldShowLinkUCDPopup( f11_arg1.controller, true ) == true then
|
|
LUI.FlowManager.RequestPopupMenu( f11_arg0, "cod_anywhere_link_ucd_popup_menu", true, f11_arg1.controller )
|
|
else
|
|
CoDAnywhere.DownloadNonUCDPlatforms( f11_arg1.controller )
|
|
end
|
|
end
|
|
|
|
function disableCreateGameButtons()
|
|
if SvS.IsSvS() and SvS.IsCurrentSquadModeDisabled() then
|
|
return true
|
|
end
|
|
local f12_local0 = Lobby.IsInPrivateParty()
|
|
local f12_local1 = Lobby.IsPrivatePartyHost()
|
|
local f12_local2 = Lobby.IsPartyHostWaitingOnMembers()
|
|
local f12_local3
|
|
if not f12_local0 or f12_local1 then
|
|
f12_local3 = f12_local2
|
|
else
|
|
f12_local3 = true
|
|
end
|
|
return f12_local3
|
|
end
|
|
|
|
function shouldDisableSoloMatch()
|
|
return Lobby.GetMemberCount( Lobby.MemberListStates.Prelobby ) ~= 1
|
|
end
|
|
|
|
function checkInParty()
|
|
return Lobby.IsInPrivateParty() and not Lobby.IsAloneInPrivateParty()
|
|
end
|
|
|
|
function TriggerLeaveLiveMenu( f15_arg0, f15_arg1 )
|
|
local f15_local0 = Engine.HasActiveLocalClient( f15_arg1.controller )
|
|
if f15_local0 then
|
|
f15_local0 = not Engine.IsActiveLocalClientPrimary( f15_arg1.controller )
|
|
end
|
|
if f15_local0 then
|
|
local f15_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f15_arg0 )
|
|
if f15_local1 and f15_local1.focusedPage and f15_local1.focusedPage > 2 then
|
|
f15_arg0:dispatchEventToRoot( {
|
|
name = "lobby_slide_left",
|
|
immediate = true
|
|
} )
|
|
end
|
|
elseif checkInParty() then
|
|
LUI.FlowManager.RequestPopupMenu( f15_arg0, "leaveprelobbywarning", true, f15_arg1.controller, false, {} )
|
|
else
|
|
LeaveXboxLive( f15_arg0, f15_arg1 )
|
|
end
|
|
end
|
|
|
|
function LeaveXboxLive( f16_arg0, f16_arg1 )
|
|
local f16_local0 = Engine.GetFirstActiveController()
|
|
Engine.Exec( "xstopprivateparty", f16_local0 )
|
|
if not SvS.IsSvS() then
|
|
Engine.SetDvarBool( "onlinegame", false )
|
|
Engine.SetDvarBool( "splitscreen", false )
|
|
Engine.Exec( "forcesplitscreencontrol menu_xboxlive_CLOSE", f16_local0 )
|
|
end
|
|
LUI.FlowManager.RequestLeaveMenuByName( "menu_xboxlive" )
|
|
end
|
|
|
|
function XboxliveMainSpeechHandler( f17_arg0, f17_arg1 )
|
|
if Engine.HasSpeechFeature() then
|
|
LUI.Speech.ProcessActionEvent( f17_arg0, f17_arg1, Kinect.LobbySpeechGrammarHandlersArray )
|
|
end
|
|
end
|
|
|
|
function XboxliveMainCreate( f18_arg0, f18_arg1 )
|
|
if SvS.IsSvS() then
|
|
LUI.FlowManager.RequestSetStack( f18_arg0, {
|
|
{
|
|
name = "mp_main_menu"
|
|
},
|
|
{
|
|
name = "squads_mode_select_menu"
|
|
}
|
|
} )
|
|
else
|
|
LUI.FlowManager.RequestSetStack( f18_arg0, {
|
|
{
|
|
name = "mp_main_menu"
|
|
}
|
|
} )
|
|
end
|
|
local f18_local0 = Engine.GetFirstActiveController()
|
|
f18_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addBackButton )
|
|
if Lobby.GetNATType then
|
|
local f18_local1 = Lobby.GetNATType()
|
|
if f18_local1 then
|
|
f18_arg0:processEvent( {
|
|
name = "add_button_helper_text",
|
|
button_ref = "nat",
|
|
helper_text = Engine.Localize( "NETWORK_YOURNATTYPE", f18_local1 ),
|
|
side = "right",
|
|
clickable = false
|
|
} )
|
|
end
|
|
end
|
|
ConfigureResolution()
|
|
if not Engine.GetDvarBool( "splitscreen" ) then
|
|
Engine.Exec( "forcenosplitscreencontrol menu_xboxlive_OPEN", f18_local0 )
|
|
end
|
|
Engine.SetDvarBool( "squad_match", false )
|
|
if Engine.IsAliensMode() then
|
|
Engine.SetDvarInt( "party_maxplayers", 4 )
|
|
LUI.mp_menus.Aliens.SetEnableChaosMode( false )
|
|
end
|
|
if not Engine.IsAliensMode() then
|
|
syncXP( f18_local0, Cac.GetActiveSquadMember( f18_local0 ) )
|
|
MLG.SetUsingMLGRules( false )
|
|
end
|
|
if SvS.IsSvS() then
|
|
assert( Engine.GetDvarBool( "onlinegame" ) )
|
|
end
|
|
Engine.ExecNow( "uploadstats", f18_local0 )
|
|
end
|
|
|
|
function getTitleText()
|
|
local f19_local0 = ""
|
|
if SvS.IsSvS() then
|
|
local f19_local1 = SvS.GetCurrentSquadModeInfo()
|
|
if f19_local1 then
|
|
local f19_local2 = SvS.GetSquadModeTitleText( f19_local1 )
|
|
end
|
|
f19_local0 = f19_local2 or ""
|
|
else
|
|
f19_local0 = Engine.Localize( "@PLATFORM_PLAY_ONLINE_CAPS" )
|
|
end
|
|
return f19_local0
|
|
end
|
|
|
|
function PreLobbyNavigationPages( f20_arg0 )
|
|
local f20_local0 = {
|
|
[#f20_local0 + 1] = {
|
|
title = getTitleText(),
|
|
element = {
|
|
type = "UIElement",
|
|
id = "lobby_options_container_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
handlers = {
|
|
lobby_page_enter = MBh.EmitEventToRoot( "show_persistent_background" ),
|
|
lobby_page_leave = MBh.EmitEventToRoot( "hide_persistent_background" )
|
|
},
|
|
children = {
|
|
{
|
|
type = "xboxlive_options_vlist",
|
|
id = "xboxlive_options_vlist_id",
|
|
childrenFeeder = XboxLiveOptionsFeeder
|
|
},
|
|
{
|
|
type = "global_activity_map",
|
|
id = "global_activity_map_id"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
[#f20_local0 + 1] = {
|
|
title = Engine.Localize( "@LUA_MENU_LOBBY_LIST_CAPS" ),
|
|
element = {
|
|
type = "member_list",
|
|
id = "lobby_member_list_id",
|
|
properties = {
|
|
memberListState = Lobby.MemberListStates.Prelobby,
|
|
additional_handlers = {
|
|
lobby_page_left = function ( f21_arg0, f21_arg1 )
|
|
f21_arg0:animateToState( "page_left", f21_arg1.animTime or 0, true )
|
|
end,
|
|
lobby_page_right = function ( f22_arg0, f22_arg1 )
|
|
f22_arg0:animateToState( "page_right", f22_arg1.animTime or 0, true )
|
|
end
|
|
}
|
|
},
|
|
states = {
|
|
default = {
|
|
alignment = LUI.Alignment.Top,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 550,
|
|
top = GenericMenuDims.menu_top,
|
|
bottom = GenericMenuDims.menu_bottom + 25,
|
|
spacing = GetMemberListSpacing and GetMemberListSpacing( true ) or 2
|
|
},
|
|
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
|
|
f20_local0[#f20_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
|
|
f20_local0[#f20_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 ( f23_arg0, f23_arg1 )
|
|
f23_arg0:animateToState( "page_left", f23_arg1.animTime or 0, true )
|
|
end,
|
|
lobby_page_right = function ( f24_arg0, f24_arg1 )
|
|
f24_arg0:animateToState( "page_right", f24_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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
f20_local0[#f20_local0 + 1] = {
|
|
element = {
|
|
type = "lobby_player_stats",
|
|
id = "lobby_player_comparison_id",
|
|
properties = {
|
|
isComparison = true,
|
|
additional_handlers = {
|
|
lobby_page_left = function ( f25_arg0, f25_arg1 )
|
|
f25_arg0:animateToState( "page_left", f25_arg1.animTime or 0, true )
|
|
end,
|
|
lobby_page_right = function ( f26_arg0, f26_arg1 )
|
|
f26_arg0:animateToState( "page_right", f26_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
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return f20_local0
|
|
end
|
|
|
|
function UpdatePlayersInPartyText( f27_arg0, f27_arg1 )
|
|
assert( f27_arg0.properties.text )
|
|
f27_arg0:setText( Engine.GetDvarString( "party_partyplayercount" ) )
|
|
end
|
|
|
|
function disableStoreButton()
|
|
if Engine.IsPS3() or Engine.IsPS4() then
|
|
return disableCreateGameButtons()
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function XboxLiveOptionsFeeder( f29_arg0 )
|
|
local f29_local0 = Engine.IsAliensMode()
|
|
local f29_local1 = SvS.IsSvS()
|
|
local f29_local2 = SvS.IsSvS()
|
|
if f29_local2 then
|
|
f29_local2 = SvS.GetCurrentSquadModeInfo()
|
|
end
|
|
local f29_local3 = {}
|
|
local f29_local4 = nil
|
|
if f29_local0 then
|
|
f29_local4 = Engine.Localize( "@LUA_MENU_PUBLIC_MATCH_CAPS" )
|
|
elseif f29_local1 then
|
|
f29_local4 = Engine.Localize( "@PLATFORM_FIND_GAME_CAPS" )
|
|
else
|
|
f29_local4 = Engine.Localize( "@PLATFORM_FIND_GAME_CAPS" )
|
|
end
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "find_match_button_id",
|
|
disabled = disableCreateGameButtons(),
|
|
properties = {
|
|
button_text = f29_local4,
|
|
button_action_func = FindMatchAction,
|
|
desc_text = SvS.IsSvS() and Engine.Localize( "@LUA_MENU_SQUADS_FIND_MATCH_DESC" ) or Engine.Localize( "@PLATFORM_DESC_FIND_GAME" ),
|
|
disabledFunc = disableCreateGameButtons,
|
|
additional_handlers = {
|
|
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
|
|
}
|
|
}
|
|
}
|
|
if f29_local0 then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "solo_match_button_id",
|
|
disabled = shouldDisableSoloMatch(),
|
|
properties = {
|
|
button_text = Engine.Localize( "@LUA_MENU_SOLO_MATCH_CAPS" ),
|
|
button_action_func = SoloMatchAction,
|
|
desc_text = Engine.Localize( "@LUA_MENU_SOLO_MATCH_DESC" ),
|
|
disabledFunc = shouldDisableSoloMatch,
|
|
additional_handlers = {
|
|
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
|
|
}
|
|
}
|
|
}
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "private_match_button_id",
|
|
disabled = disableCreateGameButtons(),
|
|
properties = {
|
|
button_text = Engine.Localize( "@LUA_MENU_CUSTOM_MATCH_CAPS" ),
|
|
button_action_func = PrivateMatchAction,
|
|
desc_text = Engine.Localize( "@LUA_MENU_DESC_PRIVATE_MATCH" ),
|
|
disabledFunc = disableCreateGameButtons,
|
|
additional_handlers = {
|
|
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
|
|
}
|
|
}
|
|
}
|
|
end
|
|
if not f29_local0 then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "create_squad_button_id",
|
|
disabled = false,
|
|
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" ),
|
|
additional_handlers = {
|
|
refresh_new_icons = function ( f30_arg0, f30_arg1 )
|
|
if Cac.AnyUnseenMDLCItems( Engine.GetFirstActiveController(), NewIconsTable.CACItemTypes ) then
|
|
f30_arg0:processEvent( {
|
|
name = "show_new_icon"
|
|
} )
|
|
end
|
|
end
|
|
}
|
|
}
|
|
}
|
|
else
|
|
f29_local3[#f29_local3 + 1] = LUI.mp_menus.AliensLoadout.GetAliensLoadoutButton()
|
|
end
|
|
local f29_local5 = {
|
|
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 ( f31_arg0, f31_arg1 )
|
|
if Engine.IsUserAGuest( f31_arg1.controller ) then
|
|
LUI.FlowManager.RequestPopupMenu( f31_arg0, "popup_no_guest", true, f31_arg1.controller )
|
|
else
|
|
LUI.FlowManager.RequestAddMenu( f31_arg0, "leaderboards", true, f31_arg1.controller )
|
|
end
|
|
end
|
|
}
|
|
}
|
|
if f29_local1 and f29_local2.HasLeaderboard then
|
|
f29_local3[#f29_local3 + 1] = f29_local5
|
|
end
|
|
if f29_local1 and f29_local2 and f29_local2.HasReports then
|
|
f29_local3[#f29_local3 + 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 ( f32_arg0, f32_arg1 )
|
|
LUI.FlowManager.RequestAddMenu( f32_arg0, "squad_reports_menu", false, f32_arg1.controller, false, {
|
|
controller = f32_arg1.controller
|
|
} )
|
|
end
|
|
}
|
|
}
|
|
end
|
|
if not f29_local0 and not f29_local1 then
|
|
f29_local3[#f29_local3 + 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 f29_local0 then
|
|
if not f29_local1 then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "barracks_button_id",
|
|
disabled = false,
|
|
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
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "store_button_id",
|
|
disabled = disableStoreButton(),
|
|
properties = {
|
|
button_text = Engine.Localize( "@LUA_MENU_STORE_CAPS" ),
|
|
button_action_func = storeButtonAction,
|
|
desc_text = Engine.Localize( "@LUA_MENU_STORE_DESC" ),
|
|
disabledFunc = disableStoreButton,
|
|
additional_handlers = {
|
|
refresh_new_icons = function ( f33_arg0, f33_arg1 )
|
|
if Cac.AnyUnseenMDLCItems( Engine.GetFirstActiveController(), {
|
|
"Store"
|
|
} ) then
|
|
f33_arg0:processEvent( {
|
|
name = "show_new_icon"
|
|
} )
|
|
end
|
|
end,
|
|
button_action = function ( f34_arg0, f34_arg1 )
|
|
Cac.ClearAllNewIconsForType( f34_arg1.controller, "Store" )
|
|
end
|
|
}
|
|
}
|
|
}
|
|
if not f29_local1 or f29_local2 ~= SvS.SquadModes.SquadVsSquad then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "generic_separator"
|
|
}
|
|
end
|
|
if not f29_local1 then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "private_match_button_id",
|
|
disabled = disableCreateGameButtons(),
|
|
properties = {
|
|
button_text = Engine.Localize( "@LUA_MENU_PRIVATE_MATCH_CAPS" ),
|
|
button_action_func = PrivateMatchAction,
|
|
desc_text = Engine.Localize( "@LUA_MENU_DESC_PRIVATE_MATCH" ),
|
|
disabledFunc = disableCreateGameButtons,
|
|
additional_handlers = {
|
|
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
|
|
}
|
|
}
|
|
}
|
|
end
|
|
if f29_local1 then
|
|
if f29_local2 == SvS.SquadModes.SquadAssault then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "squad_match_button_id",
|
|
disabled = disableCreateGameButtons(),
|
|
properties = {
|
|
button_text = Engine.Localize( "LUA_MENU_CHALLENGE_FRIEND_CAPS" ),
|
|
button_action_func = function ( f35_arg0, f35_arg1 )
|
|
if IsFirstTimeFlowRequired( f35_arg1.controller ) then
|
|
LUI.FlowManager.RequestAddMenu( f35_arg0, "cac_member_select_main", true, f35_arg1.controller, false, {
|
|
next_screen = "cac_edit_main",
|
|
squad_location = "squadMembers",
|
|
class_location = "loadouts",
|
|
findMatch = true
|
|
} )
|
|
elseif CheckHasRequiredDLC( f35_arg0 ) then
|
|
LUI.FlowManager.RequestPopupMenu( f35_arg0, "popup_friends", true, f35_arg1.controller, false, {
|
|
challengeMode = true
|
|
} )
|
|
end
|
|
end,
|
|
desc_text = Engine.Localize( "LUA_MENU_CHALLENGE_FRIEND_DESC" ),
|
|
disabledFunc = disableCreateGameButtons,
|
|
additional_handlers = {
|
|
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
|
|
}
|
|
}
|
|
}
|
|
end
|
|
if f29_local2 and not f29_local2.RequiresMatchmaking then
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "play_now_button_id",
|
|
disabled = disableCreateGameButtons(),
|
|
properties = {
|
|
button_text = Engine.Localize( "LUA_MENU_PLAY_NOW_CAPS" ),
|
|
button_action_func = function ( f36_arg0, f36_arg1 )
|
|
f36_arg1.squadsPlayNow = true
|
|
FindMatchAction( f36_arg0, f36_arg1 )
|
|
end,
|
|
desc_text = Engine.Localize( "LUA_MENU_PLAY_NOW_DESC" ),
|
|
disabledFunc = disableCreateGameButtons,
|
|
additional_handlers = {
|
|
check_buttons = LUI.mp_menus.MPLivePrivateLobby.RefreshButtonDisable
|
|
}
|
|
}
|
|
}
|
|
end
|
|
end
|
|
end
|
|
if f29_local0 then
|
|
f29_local3[#f29_local3 + 1] = f29_local5
|
|
if LUI.mp_menus.Aliens.CanAccessIntelMenu() then
|
|
f29_local3[#f29_local3 + 1] = LUI.mp_menus.AliensIntel.GetAliensIntelButton()
|
|
end
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "coda_button_id",
|
|
properties = {
|
|
button_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_CAPS" ),
|
|
button_action_func = LiveMenuCoDAnywhereAction,
|
|
desc_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_DESC" )
|
|
}
|
|
}
|
|
end
|
|
local f29_local6 = #f29_local3 + 1
|
|
local f29_local7 = {
|
|
type = "button_desc_text",
|
|
id = "prelobby_description_id"
|
|
}
|
|
local f29_local8 = {}
|
|
local f29_local9
|
|
if not (not SvS.IsSvS() or f29_local2 ~= SvS.SquadModes.SquadAssault) or Engine.IsAliensMode() or Engine.IsCoreMode() then
|
|
f29_local9 = 1
|
|
if not f29_local9 then
|
|
|
|
else
|
|
f29_local8.lines = f29_local9
|
|
f29_local7.properties = f29_local8
|
|
f29_local3[f29_local6] = f29_local7
|
|
f29_local3[#f29_local3 + 1] = {
|
|
type = "UITimer",
|
|
id = "bnt_lock_tmr",
|
|
properties = {
|
|
event = "check_buttons",
|
|
interval = 500,
|
|
disposable = false,
|
|
broadcastToRoot = true
|
|
}
|
|
}
|
|
return f29_local3
|
|
end
|
|
end
|
|
f29_local9 = nil
|
|
end
|
|
|
|
function xboxlive_options_vlist()
|
|
local f37_local0 = {
|
|
type = "UIVerticalList",
|
|
focusable = true
|
|
}
|
|
local f37_local1 = {}
|
|
local f37_local2 = {
|
|
alignment = LUI.Alignment.Top,
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = GenericMenuDims.menu_left,
|
|
right = GenericMenuDims.menu_right,
|
|
top = GenericMenuDims.menu_top,
|
|
bottom = GenericMenuDims.menu_bottom
|
|
}
|
|
if Engine.IsAliensMode() then
|
|
local f37_local3 = LUI.mp_menus.Aliens.CanAccessIntelMenu()
|
|
local f37_local4 = -2
|
|
end
|
|
f37_local2.spacing = f37_local3 and f37_local4 or 0
|
|
f37_local1.default = f37_local2
|
|
f37_local0.states = f37_local1
|
|
return f37_local0
|
|
end
|
|
|
|
function menu_xboxlive()
|
|
local f38_local0 = Engine.IsAliensMode()
|
|
local f38_local1 = {
|
|
type = "UIElement",
|
|
id = "xboxlive_main_root"
|
|
}
|
|
local f38_local2
|
|
if SvS.IsSvS() and SvS.GetCurrentSquadModeInfo() == SvS.SquadModes.SquadVsSquad then
|
|
f38_local2 = false
|
|
else
|
|
f38_local2 = true
|
|
end
|
|
f38_local1.isSignInMenu = f38_local2
|
|
f38_local1.states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
}
|
|
f38_local1.properties = {
|
|
additional_handlers = {
|
|
gain_focus = function ( f39_arg0, f39_arg1 )
|
|
f39_arg0:dispatchEventToRoot( {
|
|
name = "refresh_new_icons",
|
|
immediate = true
|
|
} )
|
|
f39_arg0:dispatchEventToRoot( {
|
|
name = "open_motd",
|
|
immediate = true
|
|
} )
|
|
if Engine.IsAliensMode() then
|
|
LUI.mp_menus.Aliens.syncEggXP()
|
|
end
|
|
end,
|
|
restore_focus = function ( f40_arg0, f40_arg1 )
|
|
f40_arg0:dispatchEventToRoot( {
|
|
name = "refresh_new_icons",
|
|
immediate = true
|
|
} )
|
|
if Engine.IsAliensMode() then
|
|
LUI.mp_menus.Aliens.syncEggXP()
|
|
end
|
|
end
|
|
}
|
|
}
|
|
f38_local1.handlers = {
|
|
menu_create = XboxliveMainCreate,
|
|
speech_action = XboxliveMainSpeechHandler,
|
|
find_match_after_throttle = FindMatchAfterThrottleEvent,
|
|
xboxlive_refresh_menu = function ( f41_arg0, f41_arg1 )
|
|
f41_arg0:processEvent( {
|
|
name = "menu_refresh"
|
|
} )
|
|
f41_arg0:dispatchEventToChildren( {
|
|
name = "update_header_text",
|
|
string = getTitleText(),
|
|
immediate = true
|
|
} )
|
|
end
|
|
}
|
|
f38_local1.children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "xboxlive_root_background_id",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "bkgd_cas" ),
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
alpha = 0
|
|
},
|
|
visible = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
show_persistent_background = MBh.AnimateToState( "default", 200 ),
|
|
hide_persistent_background = MBh.AnimateToState( "visible", 200 )
|
|
}
|
|
},
|
|
{
|
|
type = "lobby_navigation",
|
|
properties = {
|
|
lobbyNavigationPages = PreLobbyNavigationPages
|
|
}
|
|
},
|
|
{
|
|
type = "UIText",
|
|
id = "party_size_text_id",
|
|
properties = {
|
|
text = ""
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 720,
|
|
right = 1118,
|
|
top = 67,
|
|
bottom = 67 + CoD.TextSettings.SmallFont.Height,
|
|
alignment = LUI.Alignment.Left,
|
|
font = CoD.TextSettings.SmallFont.Font,
|
|
red = 0.5,
|
|
green = 0.5,
|
|
blue = 0.5,
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
member_list_refresh = UpdatePlayersInPartyText
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
id = "squads_mode_too_many_players_container_id",
|
|
properties = {
|
|
initialSquadMode = SvS.GetCurrentSquadModeInfo()
|
|
},
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
alpha = 0
|
|
},
|
|
active = {
|
|
alpha = 1
|
|
}
|
|
},
|
|
handlers = {
|
|
update_too_many_players = function ( f42_arg0, f42_arg1 )
|
|
if not SvS.IsSvS() then
|
|
return
|
|
end
|
|
local f42_local0 = true
|
|
local f42_local1 = SvS.GetCurrentSquadModeInfo()
|
|
if SvS.IsSquadModeDisabled( f42_local1 ) then
|
|
local f42_local2, f42_local3 = SvS.GetPlaylistFromSquadMode( f42_local1 )
|
|
f42_local0 = Playlist.GetItemMaxParty( f42_local2, f42_local3 ) >= Lobby.GetMemberCount( Lobby.MemberListStates.Prelobby )
|
|
end
|
|
local f42_local3 = f42_arg0
|
|
local f42_local2 = f42_arg0.animateToState
|
|
local f42_local4
|
|
if f42_local0 then
|
|
f42_local4 = "default"
|
|
if not f42_local4 then
|
|
|
|
else
|
|
f42_local2( f42_local3, f42_local4, 200 )
|
|
if (Engine.IsPS3() or Engine.IsPS4()) and (f42_local1 == SvS.SquadModes.SquadAssault or f42_local1 == SvS.SquadModes.SquadVsSquad) and Engine.CanViewClanTags() == false then
|
|
LeaveXboxLive( f42_arg0, f42_arg1 )
|
|
SvS.ShowChatRestrict = true
|
|
end
|
|
if f42_arg0.properties.initialSquadMode and f42_arg0.properties.initialSquadMode ~= f42_local1 then
|
|
f42_arg0.properties.initialSquadMode = f42_local1
|
|
f42_arg0:dispatchEventToParent( {
|
|
name = "xboxlive_refresh_menu"
|
|
} )
|
|
end
|
|
end
|
|
end
|
|
f42_local4 = "active"
|
|
end
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
id = "too_many_players_icon",
|
|
states = {
|
|
default = {
|
|
material = RegisterMaterial( "icon_new" ),
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 80,
|
|
width = 28,
|
|
top = 88,
|
|
height = 28
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIMarqueeText",
|
|
id = "too_many_players_text",
|
|
properties = {
|
|
text = Engine.Localize( "LUA_MENU_TOO_MANY_PLAYERS" )
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.frontend_hilite, {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 111,
|
|
right = -23,
|
|
top = 91,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "UITimer",
|
|
id = "too_many_layers_timer",
|
|
properties = {
|
|
event = "update_too_many_players",
|
|
interval = 100
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIMarqueeText",
|
|
id = "missing_dlc_text",
|
|
properties = {
|
|
text = ""
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.orange, {
|
|
leftAnchor = false,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = -660,
|
|
right = -60,
|
|
top = 91,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
},
|
|
handlers = {
|
|
update_missing_dlc_text = function ( f43_arg0, f43_arg1 )
|
|
local f43_local0, f43_local1, f43_local2 = Engine.PartyMissingMapPacks()
|
|
if f43_local0 and f43_local2 then
|
|
f43_arg0:setText( Engine.Localize( "DLC_PLAYER_DOESNT_HAVE_MAP_PACK", Engine.MarkLocalized( f43_local2 ), Engine.Localize( f43_local1 ) ) )
|
|
else
|
|
f43_arg0:setText( "" )
|
|
end
|
|
end
|
|
},
|
|
children = {
|
|
{
|
|
type = "UITimer",
|
|
id = "missing_dlc_text_timer",
|
|
properties = {
|
|
event = "update_missing_dlc_text",
|
|
interval = 100
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
id = "lobby_bind_buttons_id",
|
|
handlers = {
|
|
button_secondary = TriggerLeaveLiveMenu,
|
|
exit_live_lobby = LeaveXboxLive
|
|
}
|
|
},
|
|
{
|
|
type = "SocialFeedTicker",
|
|
id = "social_ticker_id"
|
|
},
|
|
{
|
|
type = "character_playing_as",
|
|
id = "character_playing_as_id"
|
|
},
|
|
{
|
|
type = "button_helper_text_main",
|
|
id = "cac_button_helper_text_id"
|
|
},
|
|
{
|
|
type = "online_friends_widget",
|
|
id = "online_friends_widget_id"
|
|
}
|
|
}
|
|
return f38_local1
|
|
end
|
|
|
|
function MPXboxLivePopFunc()
|
|
clearMatchData()
|
|
if not SvS.IsSvS() then
|
|
PersistentBackground.ProcessEvent( {
|
|
name = "unblur_persistent_background",
|
|
duration = 500
|
|
} )
|
|
end
|
|
end
|
|
|
|
function MPXboxLivePushFunc()
|
|
if not SvS.IsSvS() then
|
|
PersistentBackground.ProcessEvent( {
|
|
name = "blur_persistent_background",
|
|
duration = 500
|
|
} )
|
|
end
|
|
Engine.PLMRefreshData()
|
|
end
|
|
|
|
LUI.MenuBuilder.registerDef( "menu_xboxlive", menu_xboxlive )
|
|
LUI.FlowManager.RegisterStackPopBehaviour( "menu_xboxlive", MPXboxLivePopFunc )
|
|
LUI.FlowManager.RegisterStackPushBehaviour( "menu_xboxlive", MPXboxLivePushFunc )
|
|
LUI.MenuBuilder.registerDef( "xboxlive_options_vlist", xboxlive_options_vlist )
|
|
LockTable( _M )
|