1686 lines
49 KiB
Lua
1686 lines
49 KiB
Lua
local f0_local0 = module
|
|
local f0_local1, f0_local2 = ...
|
|
f0_local0( f0_local1, package.seeall )
|
|
CoD.PrintModuleLoad( _NAME )
|
|
function popup_elite_sell()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "sell_elite_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MPUI_ELITE_SELL_TITLE" ),
|
|
message_text = Engine.Localize( "@MPUI_ELITE_SELL_DESC" ),
|
|
yes_action = eliteConfirmSaleHandler,
|
|
yes_text = Engine.Localize( "@MPUI_ELITE_SELL_CONFIRM" ),
|
|
no_text = Engine.Localize( "@MPUI_ELITE_SELL_NOTHANKS" )
|
|
}
|
|
}
|
|
end
|
|
|
|
f0_local0 = function ( f2_arg0, f2_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f2_arg0, nil )
|
|
end
|
|
|
|
partyEndedDialogHeight = 400
|
|
f0_local1 = function ( f3_arg0, f3_arg1 )
|
|
local f3_local0 = Engine.Localize( "@MENU_NOTICE" )
|
|
local f3_local1 = Engine.Localize( Engine.GetDvarString( "partyend_reason" ) )
|
|
f3_arg0:dispatchEventToChildren( {
|
|
name = "update_title",
|
|
title_text = f3_local0
|
|
} )
|
|
f3_arg0:dispatchEventToChildren( {
|
|
name = "update_message",
|
|
message_text = f3_local1
|
|
} )
|
|
end
|
|
|
|
f0_local2 = function ( f4_arg0, f4_arg1 )
|
|
Engine.ResolveError( f4_arg1.controller )
|
|
Engine.ClearError( f4_arg1.controller )
|
|
end
|
|
|
|
function menu_xboxlive_partyended()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "menu_xboxlive_partyended_id",
|
|
properties = {
|
|
confirmation_action = f0_local2,
|
|
dialog_top = -partyEndedDialogHeight / 2,
|
|
dialog_bottom = partyEndedDialogHeight / 2
|
|
},
|
|
handlers = {
|
|
menu_create = f0_local1,
|
|
menu_close = xlivePartyEndedClose,
|
|
popup_back = function ( f6_arg0, f6_arg1 )
|
|
if Engine.ClearCompletionResolve then
|
|
Engine.ClearCompletionResolve()
|
|
end
|
|
end
|
|
|
|
}
|
|
}
|
|
end
|
|
|
|
function CancelButton( f7_arg0, f7_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f7_arg0 )
|
|
end
|
|
|
|
function popup_gettingdata()
|
|
return {
|
|
type = "live_dialog_text_box_with_cancel",
|
|
id = "popup_gettingdata_id",
|
|
properties = {
|
|
message = Engine.Localize( "@MENU_POPUP_ONLINEDATA" ),
|
|
cancel_func = LUI.common_menus.CommonPopups.CancelAcceptingInvite
|
|
},
|
|
handlers = {
|
|
menu_close = MBh.EmitEventToRoot( {
|
|
name = "online_data_finished"
|
|
} )
|
|
}
|
|
}
|
|
end
|
|
|
|
function popup_gettinglb()
|
|
return {
|
|
type = "live_dialog_text_box",
|
|
id = "popup_gettinglb_id",
|
|
properties = {
|
|
message = Engine.Localize( "@MENU_DOWNLOADING" ),
|
|
cancel_func = CancelButton
|
|
}
|
|
}
|
|
end
|
|
|
|
function popup_getting_socialconfig()
|
|
return {
|
|
type = "live_dialog_text_box",
|
|
id = "popup_getting_socialconfig_id",
|
|
properties = {
|
|
message = Engine.Localize( "@MENU_PLEASE_WAIT" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function ResetStatsConfirm( f11_arg0, f11_arg1 )
|
|
Engine.ResetStatsConfirm( f11_arg1.controller )
|
|
end
|
|
|
|
function ResetStatsCancel( f12_arg0, f12_arg1 )
|
|
Engine.ExecNow( "forcenosplitscreencontrol resetStats_Cancel", f12_arg1.controller )
|
|
Engine.ResetStatsCancel( f12_arg1.controller )
|
|
end
|
|
|
|
function menu_resetstats_warning()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
properties = {
|
|
message_text = Engine.GetDvarString( "com_errorMessage" ),
|
|
popup_title = Engine.GetDvarString( "com_errorTitle" ),
|
|
yes_text = Engine.Localize( "@MENU_STATS_RESET_YES" ),
|
|
no_text = Engine.Localize( "@MENU_STATS_RESET_NO" ),
|
|
yes_action = ResetStatsConfirm,
|
|
no_action = ResetStatsCancel
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local3 = function ( f14_arg0, f14_arg1 )
|
|
Engine.Exec( "downloadplaylist", f14_arg1.controller )
|
|
end
|
|
|
|
function downloadingplaylist()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "menu_xboxlive_downloading_id",
|
|
properties = {
|
|
confirmation_action = f0_local3,
|
|
dialog_top = -100,
|
|
dialog_bottom = 100,
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@MPUI_DOWNLOADPLAYLIST" ),
|
|
button_text = Engine.Localize( "@MENU_OK" )
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local4 = function ( f16_arg0, f16_arg1 )
|
|
local f16_local0 = Engine.GetDvarString( "com_errorTitle" )
|
|
local f16_local1 = Engine.GetDvarString( "com_errorMessage" )
|
|
f16_arg0:dispatchEventToChildren( {
|
|
name = "update_title",
|
|
title_text = f16_local0
|
|
} )
|
|
f16_arg0:dispatchEventToChildren( {
|
|
name = "update_message",
|
|
message_text = f16_local1
|
|
} )
|
|
end
|
|
|
|
local f0_local5 = function ( f17_arg0, f17_arg1 )
|
|
Engine.ClearError( f17_arg1.controller )
|
|
end
|
|
|
|
function error_popmenu_lobby()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "error_popmenu_lobby_id",
|
|
properties = {
|
|
confirmation_action = f0_local5
|
|
},
|
|
handlers = {
|
|
menu_create = f0_local4
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local6 = function ( f19_arg0, f19_arg1 )
|
|
local f19_local0 = Engine.Localize( "@MENU_NOTICE" )
|
|
local f19_local1 = Engine.Localize( "@MPUI_YOUAREHOST" )
|
|
f19_arg0:dispatchEventToChildren( {
|
|
name = "update_title",
|
|
title_text = f19_local0
|
|
} )
|
|
f19_arg0:dispatchEventToChildren( {
|
|
name = "update_message",
|
|
message_text = f19_local1
|
|
} )
|
|
end
|
|
|
|
local f0_local7 = function ( f20_arg0, f20_arg1 )
|
|
|
|
end
|
|
|
|
function youarehost()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "youarehost",
|
|
properties = {
|
|
confirmation_action = f0_local7
|
|
},
|
|
handlers = {
|
|
menu_create = f0_local6
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local8 = function ( f22_arg0, f22_arg1 )
|
|
|
|
end
|
|
|
|
function makehostfailed()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "makehostfailed",
|
|
properties = {
|
|
title_text = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( Engine.GetDvarString( "party_makehosterrormsg" ) ),
|
|
confirmation_action = f0_local8
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local9 = function ( f24_arg0, f24_arg1 )
|
|
Engine.Exec( "party_acceptinvite" )
|
|
end
|
|
|
|
local f0_local10 = function ( f25_arg0, f25_arg1 )
|
|
|
|
end
|
|
|
|
function partyinviteconfirm()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "partyinviteconfirm",
|
|
properties = {
|
|
message_text = Engine.GetDvarString( "party_invitequestion" ),
|
|
popup_title = Engine.Localize( "@MPUI_PARTY_INVITE_TITLE" ),
|
|
yes_text = Engine.Localize( "@MPUI_PARTY_INVITE_ACCEPT" ),
|
|
no_text = Engine.Localize( "@MPUI_PARTY_INVITE_DECLINE" ),
|
|
yes_action = f0_local9,
|
|
no_action = f0_local10
|
|
}
|
|
}
|
|
end
|
|
|
|
function ShowSigninWarning( f27_arg0 )
|
|
if Engine.GetDvarBool( "splitscreen" ) and not Engine.AllSplitscreenProfilesSignedIn() then
|
|
return true
|
|
elseif not Engine.GetDvarBool( "splitscreen" ) and Engine.OfflineProfileCanSave( f27_arg0 ) then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function ShowSaveWarning( f28_arg0 )
|
|
if Engine.GetDvarBool( "splitscreen" ) and not Engine.AllSplitscreenProfilesCanSave() then
|
|
return true
|
|
elseif not Engine.GetDvarBool( "splitscreen" ) and not Engine.OfflineProfileCanSave( f28_arg0 ) then
|
|
return true
|
|
else
|
|
return false
|
|
end
|
|
end
|
|
|
|
function GetSaveWarningText( f29_arg0 )
|
|
if ShowSigninWarning( f29_arg0 ) then
|
|
return Engine.Localize( "@MENU_NO_SAVE_DEVICE_WARNING_MP" )
|
|
elseif Engine.GetDvarBool( "ui_multiplayer" ) then
|
|
return Engine.Localize( "@MENU_NO_SAVE_DEVICE_WARNING_MP" )
|
|
else
|
|
return Engine.UserWithoutOfflineProfile()
|
|
end
|
|
end
|
|
|
|
function GetGuestSaveWarningText( f30_arg0 )
|
|
if ShowSigninWarning( f30_arg0 ) then
|
|
return Engine.Localize( "@MENU_NO_SIGNIN_WARNING_MP" )
|
|
elseif Engine.GetDvarBool( "ui_multiplayer" ) then
|
|
return Engine.Localize( "@MENU_NO_SIGNIN_WARNING_MP" )
|
|
else
|
|
return Engine.UserWithoutOfflineProfile()
|
|
end
|
|
end
|
|
|
|
local f0_local11 = function ( f31_arg0, f31_arg1 )
|
|
assert( f31_arg0.properties.exclusiveController )
|
|
local f31_local0 = f31_arg0.properties.exclusiveController
|
|
local f31_local1 = ""
|
|
if ShowSigninWarning( f31_local0 ) or ShowSaveWarning( f31_local0 ) then
|
|
if Engine.IsUserAGuest( f31_local0 ) or not Engine.IsUserSignedIn( f31_local0 ) then
|
|
f31_local1 = GetGuestSaveWarningText( f31_local0 )
|
|
else
|
|
f31_local1 = GetSaveWarningText( f31_local0 )
|
|
end
|
|
end
|
|
f31_arg0:dispatchEventToChildren( {
|
|
name = "update_message",
|
|
message_text = f31_local1
|
|
} )
|
|
end
|
|
|
|
function SaveErrorContinue( f32_arg0, f32_arg1 )
|
|
DebugPrint( "Save Error Continue" )
|
|
if Engine.GetDvarBool( "splitscreen" ) then
|
|
Engine.Exec( "endsplitscreensignin" )
|
|
if Engine.GetDvarBool( "ui_multiplayer" ) then
|
|
LUI.FlowManager.RequestAddMenu( f32_arg0, "menu_gamesetup_splitscreen", false, f32_arg1.controller, false, {} )
|
|
else
|
|
LUI.FlowManager.RequestAddMenu( f32_arg0, "menu_splitscreen_setup", false, f32_arg1.controller, false, {} )
|
|
end
|
|
else
|
|
assert( f32_arg0.properties.callback_params.continue_to_menu )
|
|
LUI.FlowManager.RequestAddMenu( f32_arg0, f32_arg0.properties.callback_params.continue_to_menu, false, f32_arg1.controller, true, {} )
|
|
end
|
|
end
|
|
|
|
function SaveErrorReturn( f33_arg0, f33_arg1 )
|
|
DebugPrint( "Save Error Cancel" )
|
|
if Engine.GetDvarBool( "splitscreen" ) then
|
|
Engine.ExecNow( "startsplitscreensignin" )
|
|
end
|
|
end
|
|
|
|
function saveGameErrorAbort( f34_arg0, f34_arg1 )
|
|
SaveErrorReturn( f34_arg0, f34_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f34_arg0, true )
|
|
end
|
|
|
|
function savegame_error_mp()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
properties = {
|
|
message_text = Engine.Localize( "@MENU_SAVE_ERROR_MP" ),
|
|
popup_title = Engine.Localize( "@MENU_SAVE_ERROR_MP" ),
|
|
yes_text = Engine.Localize( "@MENU_RESUMEGAME_NOSAVE_MP" ),
|
|
no_text = Engine.Localize( "@MENU_RETURN_SIGNIN_MP" ),
|
|
yes_action = SaveErrorContinue,
|
|
no_action = SaveErrorReturn
|
|
},
|
|
handlers = {
|
|
menu_create = f0_local11,
|
|
popup_back = function ( f36_arg0, f36_arg1 )
|
|
f36_arg0.properties:no_action( f36_arg1 )
|
|
end
|
|
,
|
|
ss_controller_unplugged = saveGameErrorAbort
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local12 = function ( f37_arg0, f37_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f37_arg0 )
|
|
LUI.FlowManager.RequestPopupMenu( f37_arg0, "cod_anywhere_sign_in_popup", true, f37_arg1.controller, true )
|
|
end
|
|
|
|
local f0_local13 = function ( f38_arg0, f38_arg1 )
|
|
LUI.FlowManager.RequestAddMenu( f38_arg0, "cod_anywhere_registration_menu", true, f38_arg1.controller, true )
|
|
end
|
|
|
|
local f0_local14 = function ( f39_arg0, f39_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f39_arg0 )
|
|
CoDAnywhere.DoNotShowPopup( f39_arg1.controller )
|
|
end
|
|
|
|
local f0_local15 = function ( f40_arg0 )
|
|
local f40_local0 = {}
|
|
local f40_local1 = {
|
|
{
|
|
text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_SIGN_IN" ),
|
|
func = f0_local12
|
|
},
|
|
{
|
|
text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_CREATE_ACCOUNT" ),
|
|
func = f0_local13
|
|
}
|
|
}
|
|
for f40_local2 = 1, #f40_local1, 1 do
|
|
f40_local0[#f40_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "cod_anywhere_button_" .. f40_local2,
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = f40_local1[f40_local2].text,
|
|
button_action_func = f40_local1[f40_local2].func
|
|
}
|
|
}
|
|
end
|
|
return f40_local0
|
|
end
|
|
|
|
local f0_local16 = function ( f41_arg0 )
|
|
local f41_local0 = {
|
|
[#f41_local0 + 1] = {
|
|
type = "UIText",
|
|
id = "cod_anywhere_account_text_id",
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_NO_LINKED_ACCOUNT" )
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.frontend_hilite, {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
right = 0,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
}
|
|
}
|
|
}
|
|
for f41_local1 = 1, 4, 1 do
|
|
local f41_local4
|
|
if f41_local1 == 4 then
|
|
f41_local4 = Colors.grey_4
|
|
if not f41_local4 then
|
|
|
|
else
|
|
f41_local0[#f41_local0 + 1] = {
|
|
type = "UIText",
|
|
id = "cod_anywhere_marketing_text_" .. f41_local1 .. "_id",
|
|
properties = {
|
|
text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_MARKETING" .. f41_local1 )
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( f41_local4, {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
right = 0,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
}
|
|
}
|
|
end
|
|
end
|
|
f41_local4 = Colors.white
|
|
end
|
|
return f41_local0
|
|
end
|
|
|
|
function cod_anywhere_popup_menu()
|
|
return {
|
|
type = "UIElement",
|
|
id = "cod_anywhere_popup",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" ),
|
|
popup_childfeeder = f0_local15,
|
|
popup_title_alignment = LUI.Alignment.Center,
|
|
func = nil
|
|
},
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "UIImage",
|
|
states = {
|
|
default = CoD.ColorizeState( Swatches.Overlay.Color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = Swatches.Overlay.AlphaMore
|
|
} )
|
|
}
|
|
},
|
|
{
|
|
type = "UIElement",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
top = -220,
|
|
width = 500,
|
|
height = 430
|
|
}
|
|
},
|
|
handlers = {
|
|
menu_create = updateSelectionListPopup
|
|
},
|
|
children = {
|
|
{
|
|
type = "generic_drop_shadow",
|
|
properties = {
|
|
offset_shadow = 0
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_titlebar",
|
|
properties = {
|
|
title_bar_text = MBh.Property( "popup_title" ),
|
|
title_bar_alignment = MBh.Property( "popup_title_alignment" ),
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "generic_menu_background",
|
|
properties = {
|
|
fill_alpha = 1
|
|
}
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "cod_anywhere_marketing_text_vlist_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 45,
|
|
bottom = 0,
|
|
left = 10,
|
|
right = -10,
|
|
alignment = LUI.Alignment.Top,
|
|
spacing = 15
|
|
}
|
|
},
|
|
childrenFeeder = f0_local16
|
|
},
|
|
{
|
|
type = "UIVerticalList",
|
|
id = "selection_list_popup_vert_list_id",
|
|
states = {
|
|
default = {
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -60,
|
|
bottom = 0,
|
|
left = 5,
|
|
right = -5,
|
|
alignment = LUI.Alignment.Top
|
|
}
|
|
},
|
|
childrenFeeder = MBh.Property( "popup_childfeeder" )
|
|
},
|
|
{
|
|
type = "UIBindButton",
|
|
handlers = {
|
|
button_secondary = f0_local14
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local17 = function ( f43_arg0, f43_arg1 )
|
|
local f43_local0 = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" )
|
|
local f43_local1 = Engine.GetDvarString( "cod_anywhere_errorMessage" )
|
|
f43_arg0:dispatchEventToChildren( {
|
|
name = "update_title",
|
|
title_text = f43_local0
|
|
} )
|
|
f43_arg0:dispatchEventToChildren( {
|
|
name = "update_message",
|
|
message_text = f43_local1
|
|
} )
|
|
end
|
|
|
|
local f0_local18 = function ( f44_arg0, f44_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f44_arg0 )
|
|
end
|
|
|
|
function cod_anywhere_error_popup_menu()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "cod_anywhere_error_popup_menu_id",
|
|
properties = {
|
|
confirmation_action = f0_local18
|
|
},
|
|
handlers = {
|
|
menu_create = f0_local17
|
|
}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_working_popup_menu()
|
|
return {
|
|
type = "live_dialog_text_box",
|
|
id = "cod_anywhere_working_popup_menu_id",
|
|
properties = {
|
|
message = Engine.Localize( "@MENU_FACEBOOK_UPLOADING" )
|
|
}
|
|
}
|
|
end
|
|
|
|
local f0_local19 = function ( f47_arg0, f47_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f47_arg0 )
|
|
f47_arg0:dispatchEventToRoot( {
|
|
name = "leave_platform_screen"
|
|
} )
|
|
end
|
|
|
|
function cod_anywhere_success_popup_menu( f48_arg0, f48_arg1 )
|
|
local f48_local0 = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" )
|
|
local f48_local1 = Engine.GetDvarString( "cod_anywhere_single_task_popup_text" )
|
|
local f48_local2 = f0_local19
|
|
local f48_local3 = "image_motd_ghost_app"
|
|
local self = LUI.UIElement.new()
|
|
self:registerAnimationState( "default", {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0
|
|
} )
|
|
self:animateToState( "default" )
|
|
local f48_local5 = LUI.UIImage.new()
|
|
f48_local5:registerAnimationState( "default", CoD.ColorizeState( Swatches.Overlay.Color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = -200,
|
|
bottom = 200,
|
|
left = 0,
|
|
right = 0,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = Swatches.Overlay.AlphaMore
|
|
} ) )
|
|
f48_local5:animateToState( "default" )
|
|
self:addElement( f48_local5 )
|
|
local f48_local6 = LUI.UIElement.new()
|
|
f48_local6:registerAnimationState( "default", {
|
|
topAnchor = false,
|
|
bottomAnchor = false,
|
|
leftAnchor = false,
|
|
rightAnchor = false,
|
|
width = 892,
|
|
height = 590
|
|
} )
|
|
f48_local6:animateToState( "default" )
|
|
self:addElement( f48_local6 )
|
|
f48_local6:addElement( LUI.MenuGenerics.generic_drop_shadow( nil, {
|
|
offset_shadow = 0,
|
|
alpha = 0.35
|
|
} ) )
|
|
f48_local6:addElement( LUI.MenuGenerics.generic_menu_titlebar( nil, {
|
|
title_bar_text = f48_local0,
|
|
fill_alpha = 1
|
|
} ) )
|
|
f48_local6:addElement( LUI.MenuGenerics.generic_menu_background( nil, {
|
|
fill_alpha = 1
|
|
} ) )
|
|
local f48_local7 = LUI.UIText.new()
|
|
f48_local7:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 490,
|
|
top = 90,
|
|
width = 367,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Left
|
|
} )
|
|
f48_local7:setText( f48_local1 )
|
|
f48_local7:animateToState( "default" )
|
|
f48_local6:addElement( f48_local7 )
|
|
local f48_local8 = LUI.UIElement.new()
|
|
f48_local8:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 58,
|
|
top = 90,
|
|
height = 342,
|
|
width = 342
|
|
} )
|
|
f48_local8:animateToState( "default" )
|
|
f48_local6:addElement( f48_local8 )
|
|
f48_local8:addElement( LUI.MenuGenerics.generic_drop_shadow( nil, {
|
|
offset_shadow = -3
|
|
} ) )
|
|
local f48_local9 = LUI.UIImage.new()
|
|
f48_local9:registerAnimationState( "default", CoD.ColorizeState( Colors.generic_button_border_color, {
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
bottom = 0,
|
|
left = 0,
|
|
right = 0,
|
|
material = RegisterMaterial( "white" )
|
|
} ) )
|
|
f48_local9:animateToState( "default" )
|
|
f48_local8:addElement( f48_local9 )
|
|
local f48_local10 = LUI.UIImage.new()
|
|
f48_local10:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 1,
|
|
right = -1,
|
|
top = 1,
|
|
bottom = -1,
|
|
material = RegisterMaterial( f48_local3 ),
|
|
alpha = 1
|
|
} )
|
|
f48_local10:animateToState( "default" )
|
|
f48_local8:addElement( f48_local10 )
|
|
local f48_local11 = LUI.UIImage.new()
|
|
f48_local11:registerAnimationState( "default", CoD.ColorizeState( Colors.generic_button_border_color, {
|
|
leftAnchor = true,
|
|
rightAnchor = false,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 446,
|
|
width = 1,
|
|
top = 90,
|
|
height = 342,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 1
|
|
} ) )
|
|
f48_local11:animateToState( "default" )
|
|
f48_local6:addElement( f48_local11 )
|
|
local f48_local12 = LUI.UIImage.new()
|
|
f48_local12.id = "horizontal_line_id"
|
|
f48_local12:registerAnimationState( "default", CoD.ColorizeState( Colors.generic_button_border_color, {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = false,
|
|
bottomAnchor = true,
|
|
left = 1,
|
|
right = -1,
|
|
bottom = -43,
|
|
height = 1,
|
|
material = RegisterMaterial( "white" ),
|
|
alpha = 1
|
|
} ) )
|
|
f48_local12:animateToState( "default" )
|
|
f48_local6:addElement( f48_local12 )
|
|
local f48_local13 = LUI.UIButton.new()
|
|
f48_local13.id = "continuebutton_id"
|
|
f48_local13:registerAnimationState( "default", {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 0
|
|
} )
|
|
f48_local13:registerEventHandler( "button_action", f48_local2 )
|
|
f48_local13:animateToState( "default" )
|
|
f48_local6:addElement( f48_local13 )
|
|
LUI.MenuBuilder.BuildAddChild( f48_local6, {
|
|
type = "UIElement",
|
|
id = "help_padding",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = true,
|
|
left = 1,
|
|
right = -1,
|
|
top = 0,
|
|
bottom = -1
|
|
}
|
|
},
|
|
children = {
|
|
{
|
|
type = "button_helper_text_main",
|
|
id = "help_texts",
|
|
properties = {
|
|
left_inset = 10,
|
|
top_margin = GenericFooterDims.TopMargin_WithoutBackground,
|
|
background_alpha = 0,
|
|
hideAlienBar = true
|
|
},
|
|
handlers = {
|
|
menu_create = function ( f49_arg0, f49_arg1 )
|
|
f49_arg0:processEvent( LUI.ButtonHelperText.CommonEvents.addActionButton )
|
|
end
|
|
}
|
|
}
|
|
}
|
|
} )
|
|
return self
|
|
end
|
|
|
|
local f0_local20 = function ( f50_arg0, f50_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f50_arg0 )
|
|
CoDAnywhere.DoNotShowPopup( f50_arg1.controller )
|
|
CoDAnywhere.DownloadNonUCDPlatforms( f50_arg0.properties.exclusiveController )
|
|
end
|
|
|
|
function cod_anywhere_link_ucd_popup_menu()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "cod_anywhere_link_ucd_popup_menu_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_LINK_UCD_DESC" ),
|
|
button_text = Engine.Localize( "@MENU_OK" ),
|
|
confirmation_action = f0_local20
|
|
},
|
|
handlers = {}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_all_done_popup_menu()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "cod_anywhere_all_done_popup_menu_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_COD_ANYWHERE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_ALL_DONE" ),
|
|
confirmation_action = MBh.LeaveMenu()
|
|
},
|
|
handlers = {}
|
|
}
|
|
end
|
|
|
|
function MainChooseExeChildrenFeeder()
|
|
local f53_local0 = {
|
|
[#f53_local0 + 1] = {
|
|
type = "UIMarqueeText",
|
|
id = "switch_to_sp_text",
|
|
properties = {
|
|
text = Engine.Localize( "@MENU_SWITCH_TO_SINGLE_PLAYER" )
|
|
},
|
|
states = {
|
|
default = CoD.ColorizeState( Colors.white, {
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
top = 0,
|
|
left = 0,
|
|
right = 0,
|
|
height = CoD.TextSettings.NormalFont.Height,
|
|
font = CoD.TextSettings.NormalFont.Font,
|
|
alignment = LUI.Alignment.Center
|
|
} )
|
|
}
|
|
},
|
|
[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "main_choose_sp_button",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = Engine.Localize( "@MENU_YES" ),
|
|
button_action_func = function ( f54_arg0, f54_arg1 )
|
|
Engine.StartSingleplayer()
|
|
end
|
|
}
|
|
},
|
|
[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "main_choose_cancel_button",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = Engine.Localize( "@LUA_MENU_CANCEL" ),
|
|
button_action_func = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
}
|
|
if not Engine.IsConsoleGame() then
|
|
f53_local0[#f53_local0 + 1] = {
|
|
type = "UIGenericButton",
|
|
id = "main_choose_exit_button",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
text = Engine.Localize( "@LUA_MENU_EXIT_GAME" ),
|
|
button_action_func = MBh.PopupMenu( "quit_popmenu", false, false )
|
|
}
|
|
}
|
|
end
|
|
return f53_local0
|
|
end
|
|
|
|
function main_choose_exe_popup_menu()
|
|
return {
|
|
type = "generic_selectionList_popup",
|
|
id = "main_choose_exe_popup_menu_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_MAIN_MENU" ),
|
|
popup_childfeeder = MainChooseExeChildrenFeeder
|
|
},
|
|
handlers = {
|
|
menu_create = function ( f56_arg0, f56_arg1 )
|
|
Engine.Exec( "forcenosplitscreencontrol openChooseExe" )
|
|
end
|
|
,
|
|
menu_close = function ( f57_arg0, f57_arg1 )
|
|
Engine.Exec( "forcesplitscreencontrol closeChooseExe" )
|
|
end
|
|
|
|
}
|
|
}
|
|
end
|
|
|
|
function AcceptInviteWarningConfirm( f58_arg0, f58_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f58_arg0, nil )
|
|
Engine.ExecNow( "confirmInvite" )
|
|
end
|
|
|
|
function AcceptInviteWarningCancel( f59_arg0, f59_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f59_arg0, nil )
|
|
end
|
|
|
|
function acceptinvite_warning()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "acceptinvite_warning_id",
|
|
properties = {
|
|
message_text = Engine.Localize( "@MENU_LEAVEPARTYWARNING" ),
|
|
popup_title = Engine.Localize( "@MENU_ACCEPTINVITETITLE" ),
|
|
yes_text = Engine.Localize( "@MENU_CONFIRMINVITE" ),
|
|
no_text = Engine.Localize( "@MENU_RESUMEGAME" ),
|
|
yes_action = AcceptInviteWarningConfirm,
|
|
no_action = AcceptInviteWarningCancel
|
|
}
|
|
}
|
|
end
|
|
|
|
function CopyLoadoutChildrenFeeder( f61_arg0 )
|
|
local f61_local0 = {}
|
|
local f61_local1 = f61_arg0.controller
|
|
if not f61_local1 then
|
|
DebugPrint( "[WARNING] CAC: using controller index 0, this is only ok if you are editing a menu" )
|
|
f61_local1 = 0
|
|
end
|
|
local f61_local2 = 1
|
|
local f61_local3 = 1
|
|
local f61_local4 = false
|
|
if Cac.IsDefaultClass( f61_arg0.classLocation ) then
|
|
f61_local4 = true
|
|
f61_local3 = 2 + 1
|
|
end
|
|
local f61_local5 = f61_arg0.classLocation
|
|
local f61_local6 = f61_arg0.squadLocation
|
|
local f61_local7 = f61_arg0.squadMemberIndex
|
|
repeat
|
|
if f61_local4 then
|
|
f61_local3 = f61_local3 - 1
|
|
if f61_local3 == 1 then
|
|
f61_local0[#f61_local0 + 1] = {
|
|
type = "UIElement",
|
|
id = "copy_spacer",
|
|
states = {
|
|
default = {
|
|
leftAnchor = true,
|
|
rightAnchor = true,
|
|
topAnchor = true,
|
|
bottomAnchor = false,
|
|
left = 0,
|
|
right = 0,
|
|
top = 0,
|
|
bottom = 10
|
|
}
|
|
}
|
|
}
|
|
end
|
|
local f61_local8 = Cac.AddTeamName( "defaultClassesTeam" .. f61_local3, f61_local3, -200 )
|
|
if f61_local8 ~= nil then
|
|
f61_local0[#f61_local0 + 1] = f61_local8
|
|
end
|
|
end
|
|
for f61_local8 = 0, Cac.GetNumCustomSlots( f61_local1, f61_local5 ) - 1, 1 do
|
|
local f61_local11 = {
|
|
type = "UIGenericButton",
|
|
properties = {
|
|
style = GenericButtonSettings.Styles.GlassButton,
|
|
substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup,
|
|
squadLocation = f61_local6,
|
|
squadMemberIndex = f61_local7,
|
|
classLocation = f61_local5,
|
|
slot = f61_local8,
|
|
button_text = Cac.GetLoadoutName( f61_local1, f61_local6, f61_local7, f61_local5, f61_local8 ),
|
|
button_action_func = function ( f62_arg0, f62_arg1 )
|
|
local f62_local0 = f62_arg0.properties
|
|
Cac.SetLoadout( f61_local1, f62_local0.squadLocation, f62_local0.squadMemberIndex, f62_local0.classLocation, f62_local0.slot, f61_arg0.classLocation, f61_arg0.slot )
|
|
f62_arg0:dispatchEventToRoot( {
|
|
name = "focus_loadout",
|
|
loadoutIndex = f62_local0.slot,
|
|
immediate = true,
|
|
dispatchChildren = true
|
|
} )
|
|
f62_arg0:dispatchEventToRoot( {
|
|
name = "update_loadout_name",
|
|
newName = Cac.GetLoadoutName( f61_local1, f62_local0.squadLocation, f62_local0.squadMemberIndex, f62_local0.classLocation, f62_local0.slot ),
|
|
loadoutIndex = f62_local0.slot,
|
|
immediate = true,
|
|
classLocation = f62_local0.classLocation
|
|
} )
|
|
LUI.FlowManager.RequestLeaveMenu( f62_arg0 )
|
|
end
|
|
}
|
|
}
|
|
local f61_local12
|
|
if f61_local8 ~= f61_arg0.slot or f61_local5 ~= f61_arg0.classLocation then
|
|
f61_local12 = Cac.IsCaCSlotLocked( f61_local1, f61_local6, f61_local7, f61_local5, f61_local8 )
|
|
else
|
|
f61_local12 = true
|
|
end
|
|
f61_local11.disabled = f61_local12
|
|
f61_local11.id = "copy_class_" .. f61_local3 .. "_" .. f61_local8
|
|
f61_local0[#f61_local0 + 1] = f61_local11
|
|
end
|
|
until not f61_local4 or f61_local4 and f61_local3 == 1
|
|
return f61_local0
|
|
end
|
|
|
|
function copy_loadout_popup()
|
|
return {
|
|
type = "generic_selectionList_popup",
|
|
id = "copy_loadout_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@LUA_MENU_DESTINATION" ),
|
|
popup_childfeeder = CopyLoadoutChildrenFeeder,
|
|
controller = 0,
|
|
squadLocation = "privateMatchSquadMembers",
|
|
squadMemberIndex = 0,
|
|
classLocation = "privateMatchCustomClasses",
|
|
slot = 0
|
|
}
|
|
}
|
|
end
|
|
|
|
function user_generated_content_restriction_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "clan_invite_restriction_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@GAME_WARNING" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_USER_CONTENT_RESTRICTIONS" ),
|
|
confirmation_action = MBh.LeaveMenu()
|
|
},
|
|
handlers = {}
|
|
}
|
|
end
|
|
|
|
function cod_anywhere_unavailable_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "cod_anywhere_unavailable_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@GAME_WARNING" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_COD_ANYWHERE_UNAVAILABLE" ),
|
|
confirmation_action = MBh.LeaveMenu()
|
|
},
|
|
handlers = {}
|
|
}
|
|
end
|
|
|
|
function CancelJoinInProgressWithPassword( f66_arg0, f66_arg1 )
|
|
Engine.SetDvarBool( "onlinegame", false )
|
|
Engine.SetDvarBool( "systemlink", false )
|
|
Engine.Exec( "stopListening" )
|
|
Engine.Exec( "useonlinestats 0" )
|
|
Engine.Exec( "statsdownloadcancel" )
|
|
Engine.Exec( "xstopparty PASSWORD_POPUP_CANCELED_ACTION" )
|
|
Engine.Exec( "xstopprivateparty" )
|
|
Engine.Exec( "xcancelconnectingdialog" )
|
|
Engine.Exec( "resetautoconnect" )
|
|
LUI.FlowManager.RequestSetStack( f66_arg0, {
|
|
{
|
|
name = "mp_main_menu"
|
|
}
|
|
} )
|
|
LUI.FlowManager.RequestLeaveMenu( f66_arg0 )
|
|
end
|
|
|
|
function jip_with_password()
|
|
local self = LUI.UIElement.new()
|
|
self.id = "jip_with_password_id"
|
|
self:registerEventHandler( "menu_create", function ( element, event )
|
|
Engine.SetDvarString( "privateMatch_joinPassword", "" )
|
|
Engine.OpenScreenKeyboard( 0, Engine.Localize( "MENU_PASSWORD" ), "", Lobby.PasswordLength, false, false, CoD.KeyboardInputTypes.Password, true )
|
|
end )
|
|
self:registerEventHandler( "text_input_complete", function ( element, event )
|
|
if not event.text then
|
|
CancelJoinInProgressWithPassword( element, event )
|
|
else
|
|
Engine.SetDvarString( "privateMatch_joinPassword", event.text )
|
|
Engine.Exec( "xjoinpasswordparty" )
|
|
LUI.FlowManager.RequestLeaveMenu( element )
|
|
end
|
|
end )
|
|
return self
|
|
end
|
|
|
|
function squad_challenge_invalid_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "squad_challenge_invalid_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_SQUADS_CANT_FIGHT_PARTY_MEMBER" ),
|
|
confirmation_action = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
end
|
|
|
|
function ContineueSearching()
|
|
Engine.SetDvarBool( "party_search_for_dlc_content", true )
|
|
Engine.Exec( "resetdlcsearchtimer" )
|
|
end
|
|
|
|
function StopSearching()
|
|
Engine.SetDvarBool( "party_search_for_dlc_content", false )
|
|
Engine.Exec( "xstoplobbybackout" )
|
|
Engine.Exec( "xblive_privatematch 0" )
|
|
LUI.FlowManager.RequestRestoreMenu( nil, "menu_xboxlive" )
|
|
end
|
|
|
|
function mp_dlc_switch_searchtype()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "mp_dlc_switch_searchtype_id",
|
|
properties = {
|
|
message_text = Engine.Localize( "@DLC_SEARCH_IS_TAKING_TIME" ),
|
|
popup_title = Engine.Localize( "@MENU_WARNING" ),
|
|
no_text = Engine.Localize( "@DLC_SEARCH_CONTINUE" ),
|
|
yes_text = Engine.Localize( "@DLC_SEARCH_STOP" ),
|
|
no_action = ContineueSearching,
|
|
yes_action = StopSearching
|
|
}
|
|
}
|
|
end
|
|
|
|
function popup_throttling()
|
|
return {
|
|
type = "UIElement",
|
|
id = "popup_throttling_id",
|
|
handlers = {
|
|
move_to_lobby = function ( f75_arg0, f75_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f75_arg0, nil )
|
|
local f75_local0 = f75_arg0.properties.eventData or {}
|
|
f75_local0.name = "find_match_after_throttle"
|
|
f75_arg1.controller = f75_arg0.properties.exclusiveController
|
|
f75_arg0:dispatchEventToRoot( f75_local0 )
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "live_dialog_text_box_with_cancel",
|
|
id = "live_dialog_text_box_with_cancel_id",
|
|
properties = {
|
|
message = Engine.Localize( "@MENU_PLEASE_WAIT" ),
|
|
cancel_func = MBh.LeaveMenu()
|
|
}
|
|
},
|
|
{
|
|
type = "UITimer",
|
|
id = "move_to_lobby_id",
|
|
properties = {
|
|
event = "move_to_lobby",
|
|
interval = Engine.GetDvarInt( "lb_throttle_time" ) * 1000,
|
|
disposable = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function mlg_error_no_rules_available_offline()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "mlg_error_no_rules_available_offline",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_MLG_NO_RULES_AVAILABLE_OFFLINE" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function mlg_error_no_rules_available()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "mlg_error_no_rules_available",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_MLG_NO_RULES_AVAILABLE" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function mp_damaged_content_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "mp_damaged_content_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_XENON_DAMAGED_DLC" ),
|
|
confirmation_action = MBh.LeaveMenu()
|
|
}
|
|
}
|
|
end
|
|
|
|
function mp_no_guest_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "mp_no_guest_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@MENU_NO_GUEST" )
|
|
}
|
|
}
|
|
end
|
|
|
|
if Engine.IsPS3() or Engine.IsPS4() then
|
|
function mp_no_squad_assault()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "mp_no_squad_assault_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@XBOXLIVE_SQUADASSAULTNOTALLOWED" )
|
|
}
|
|
}
|
|
end
|
|
|
|
end
|
|
if Engine.IsPS3() then
|
|
function mp_wrong_controller_popup()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "mp_wrong_controller_popup_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@PLATFORM_USECONTROLLER1" )
|
|
}
|
|
}
|
|
end
|
|
|
|
end
|
|
function popup_no_guest()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "no_guest_leaderboards_id",
|
|
properties = {
|
|
popup_title = Engine.Localize( "MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "PATCH_MENU_NO_GUEST" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function popup_reset_game_options()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "popup_reset_game_options_id",
|
|
properties = {
|
|
message_text = Engine.Localize( "PATCH_MENU_RESET_OPTIONS" ),
|
|
popup_title = Engine.Localize( "LUA_MENU_SET_DEFAULT_CONTROLS" ),
|
|
no_action = function ( f84_arg0, f84_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f84_arg0 )
|
|
end
|
|
,
|
|
yes_action = function ( f85_arg0, f85_arg1 )
|
|
if MLG.AreMLGRulesEnabled() then
|
|
MLG.Toggle( f85_arg0, f85_arg1 )
|
|
end
|
|
MatchRules.LoadMatchRulesDataDefault()
|
|
end
|
|
|
|
}
|
|
}
|
|
end
|
|
|
|
function goto_store()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
properties = {
|
|
message_text = Engine.Localize( "@LUA_MENU_GOTO_STORE" ),
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
yes_text = Engine.Localize( "@MENU_YES" ),
|
|
no_text = Engine.Localize( "@MENU_NO" ),
|
|
yes_action = function ( f87_arg0, f87_arg1 )
|
|
Engine.ExecNow( "uploadstats", f87_arg1.controller )
|
|
local f87_local0 = Engine.GetLuiRoot()
|
|
local f87_local1 = LUI.FlowManager.IsInStack( f87_local0.flowManager, "menu_xboxlive_privatelobby" )
|
|
local f87_local2 = LUI.FlowManager.IsInStack( f87_local0.flowManager, "menu_xboxlive_lobby" )
|
|
Engine.ExecNow( "forcesplitscreencontrol goToStore" )
|
|
if f87_local1 or f87_local2 then
|
|
f87_arg1.execNow = true
|
|
LUI.mp_menus.mpLobbyWidgets.leaveLobbyAndPartyYesActionWithExitLobby( f87_arg0, f87_arg1 )
|
|
end
|
|
LUI.FlowManager.RequestRestoreMenu( nil, "menu_xboxlive" )
|
|
Sns.OpenStoreMenu( f87_arg1.controller, "cac", false, f87_arg0.properties.callback_params.dlcName )
|
|
end
|
|
,
|
|
no_action = function ( f88_arg0, f88_arg1 )
|
|
LUI.FlowManager.RequestLeaveMenu( f88_arg0 )
|
|
end
|
|
|
|
}
|
|
}
|
|
end
|
|
|
|
function finding_player_purchases()
|
|
return {
|
|
type = "UIElement",
|
|
id = "finding_player_purchases_id",
|
|
handlers = {
|
|
menu_create = function ( f90_arg0, f90_arg1 )
|
|
Store.FindPlayerPurchases( f90_arg1.controller )
|
|
end
|
|
,
|
|
move_to_store = function ( f91_arg0, f91_arg1 )
|
|
if Store.FoundPlayerPurchases() == true then
|
|
LUI.FlowManager.RequestLeaveMenu( f91_arg0, nil )
|
|
LUI.FlowManager.RequestAddMenu( f91_arg0, "store_main", true, controller, replaceTop, f91_arg0.properties.storeData )
|
|
end
|
|
end
|
|
|
|
},
|
|
children = {
|
|
{
|
|
type = "live_dialog_text_box_with_cancel",
|
|
id = "live_dialog_text_box_with_cancel_id",
|
|
properties = {
|
|
message = Engine.Localize( "@MENU_PLEASE_WAIT" ),
|
|
cancel_func = MBh.LeaveMenu()
|
|
}
|
|
},
|
|
{
|
|
type = "UITimer",
|
|
id = "move_to_store_id",
|
|
properties = {
|
|
event = "move_to_store",
|
|
interval = 1000,
|
|
disposable = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
if Engine.IsXbox360() then
|
|
function StartDownloadRequiredDLC( f92_arg0, f92_arg1 )
|
|
Engine.Exec( "restart_compatibility_tasks" )
|
|
LUI.FlowManager.RequestLeaveMenu( f92_arg0 )
|
|
end
|
|
|
|
function AnyUserSignedIn()
|
|
for f93_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
|
if Engine.IsUserSignedIn( f93_local0 ) then
|
|
return true
|
|
end
|
|
end
|
|
return false
|
|
end
|
|
|
|
function AnyUserSignedInToLive()
|
|
for f94_local0 = 0, Engine.GetMaxControllerCount() - 1, 1 do
|
|
if Engine.IsUserSignedInToLive( f94_local0 ) then
|
|
return true
|
|
end
|
|
end
|
|
return false
|
|
end
|
|
|
|
function HandleRequiredDLCPopup()
|
|
local f95_local0 = Engine.GetDvarString( "com_errorMessage" )
|
|
if f95_local0 and f95_local0 ~= "" then
|
|
return nil
|
|
elseif not Engine.DoWeNeedCompatibilityPacks() then
|
|
return nil
|
|
elseif not AnyUserSignedIn() then
|
|
return "missing_content_signin"
|
|
elseif not Engine.FinishedMountingContent() then
|
|
return "missing_content_discovery"
|
|
elseif not AnyUserSignedInToLive() then
|
|
return "missing_content_signin"
|
|
elseif Engine.ErrorDownloadingRequiredDLC() then
|
|
return "missing_content_error"
|
|
elseif Engine.AnyoneDownloadingRequiredDLC() then
|
|
return "missing_content_downloading"
|
|
else
|
|
return "missing_content_download"
|
|
end
|
|
end
|
|
|
|
function RequestNextRequiredPopup( f96_arg0 )
|
|
local f96_local0 = HandleRequiredDLCPopup()
|
|
if f96_local0 then
|
|
LUI.FlowManager.RequestPopupMenu( nil, f96_local0, false, f96_arg0, false, false, false, true, false )
|
|
end
|
|
end
|
|
|
|
function SignInRequiredDLCComplete( f97_arg0 )
|
|
Engine.ExecNow( "forcenosplitscreencontrol SignInRequiredDLCComplete", f97_arg0 )
|
|
RequestNextRequiredPopup( f97_arg0 )
|
|
end
|
|
|
|
function SignInRequiredDLC( f98_arg0, f98_arg1 )
|
|
if HandleRequiredDLCPopup() ~= "missing_content_signin" then
|
|
UpdateRequiredDLCNotification( f98_arg0, f98_arg1 )
|
|
else
|
|
Engine.ExecWithResolve( "xsigninlive", SignInRequiredDLCComplete, f98_arg1.controller )
|
|
Engine.Exec( "forcesplitscreencontrol SignInRequiredDLC", f98_arg1.controller )
|
|
LUI.FlowManager.RequestLeaveMenu( f98_arg0 )
|
|
end
|
|
end
|
|
|
|
function DownloadRequiredDLC( f99_arg0, f99_arg1 )
|
|
Engine.ExecWithResolve( "restart_compatibility_tasks", RequestNextRequiredPopup, f99_arg1.controller )
|
|
LUI.FlowManager.RequestLeaveMenu( f99_arg0 )
|
|
end
|
|
|
|
function StartSinglePlayerExe( f100_arg0, f100_arg1 )
|
|
Engine.Exec( "forcenosplitscreencontrol StartSinglePlayerExe" )
|
|
Engine.Exec( "startSingleplayer" )
|
|
end
|
|
|
|
function UpdateRequiredDLCNotification( f101_arg0, f101_arg1 )
|
|
local f101_local0 = Engine.GetLuiRoot()
|
|
local f101_local1 = HandleRequiredDLCPopup()
|
|
if f101_local1 ~= "missing_content_discovery" and f101_local0:IsMenuOpenAndVisible( "missing_content_discovery" ) then
|
|
LUI.FlowManager.RequestLeaveMenuByName( "missing_content_discovery" )
|
|
end
|
|
if f101_local1 ~= "missing_content_downloading" and f101_local0:IsMenuOpenAndVisible( "missing_content_downloading" ) then
|
|
LUI.FlowManager.RequestLeaveMenuByName( "missing_content_downloading" )
|
|
end
|
|
if f101_local1 ~= "missing_content_signin" and f101_local0:IsMenuOpenAndVisible( "missing_content_signin" ) then
|
|
LUI.FlowManager.RequestLeaveMenuByName( "missing_content_signin" )
|
|
end
|
|
if f101_local1 ~= "missing_content_download" and f101_local0:IsMenuOpenAndVisible( "missing_content_download" ) then
|
|
LUI.FlowManager.RequestLeaveMenuByName( "missing_content_download" )
|
|
end
|
|
if f101_local1 ~= "missing_content_error" and f101_local0:IsMenuOpenAndVisible( "missing_content_error" ) then
|
|
LUI.FlowManager.RequestLeaveMenuByName( "missing_content_error" )
|
|
end
|
|
local f101_local2 = f101_arg1.controller
|
|
if not f101_local2 and Engine.SplitscreenPlayerCount() ~= 0 then
|
|
f101_local2 = Engine.GetFirstActiveController()
|
|
end
|
|
if f101_local1 and not f101_local0:IsMenuOpenAndVisible( f101_local1 ) then
|
|
LUI.FlowManager.RequestPopupMenu( nil, f101_local1, false, f101_local2, false, false, false, false, false )
|
|
end
|
|
end
|
|
|
|
function ErrorRequiredDLC()
|
|
local f102_local0, f102_local1 = Engine.ErrorDownloadingRequiredDLC()
|
|
if f102_local0 then
|
|
if f102_local1 == CoD.RequiredDLCError.COMPATIBILITY_ERROR_DISK_FULL then
|
|
return Engine.Localize( "@LUA_MENU_MP_ERROR_FULL_REQUIRED_DLC" )
|
|
elseif f102_local1 == CoD.RequiredDLCError.COMPATIBILITY_ERROR_CORRUPTED then
|
|
return Engine.Localize( "@LUA_MENU_MP_ERROR_CORRUPT_REQUIRED_DLC" )
|
|
elseif f102_local1 == CoD.RequiredDLCError.COMPATIBILITY_ERROR_CANCELED then
|
|
return Engine.Localize( "@LUA_MENU_MP_ERROR_CANCEL_REQUIRED_DLC" )
|
|
else
|
|
return Engine.Localize( "@LUA_MENU_MP_ERROR_REQUIRED_DLC" )
|
|
end
|
|
else
|
|
return Engine.Localize( "@LUA_MENU_MP_ERROR_REQUIRED_DLC" )
|
|
end
|
|
end
|
|
|
|
function need_to_download_required_dlc()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "need_to_download_required_dlc",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_MP_NEED_REQUIRED_DLC" ),
|
|
yes_action = StartDownloadRequiredDLC,
|
|
no_text = Engine.Localize( "@LUA_MENU_CANCEL" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function currently_downloading_required_dlc()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "currently_downloading_required_dlc",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_MP_DOWNLOADING_REQUIRED_DLC" ),
|
|
button_text = Engine.Localize( "@MENU_OK" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function missing_content_signin()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "missing_content_signin",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = AnyUserSignedIn() and Engine.Localize( "@LUA_MENU_MP_LIVE_SIGNIN_REQUIRED_DLC" ) or Engine.Localize( "@LUA_MENU_MP_SIGNIN_REQUIRED_DLC" ),
|
|
message_text_alignment = LUI.Alignment.Left,
|
|
default_focus_index = 1,
|
|
yes_action = SignInRequiredDLC,
|
|
yes_text = AnyUserSignedIn() and Engine.Localize( "@XBOXLIVE_SIGNIN" ) or Engine.Localize( "LUA_MENU_COD_ANYWHERE_SIGN_IN" ),
|
|
no_action = StartSinglePlayerExe,
|
|
no_text = Engine.Localize( "@MENU_SWITCH_TO_SINGLE_PLAYER" ),
|
|
additional_handlers = {
|
|
dlc_mount_complete = UpdateRequiredDLCNotification,
|
|
dlc_mount_fail = UpdateRequiredDLCNotification,
|
|
dlc_download_fail = UpdateRequiredDLCNotification
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function missing_content_download()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "missing_content_download",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = Engine.Localize( "@LUA_MENU_MP_NEED_REQUIRED_DLC" ),
|
|
message_text_alignment = LUI.Alignment.Left,
|
|
default_focus_index = 1,
|
|
yes_action = DownloadRequiredDLC,
|
|
no_action = StartSinglePlayerExe,
|
|
no_text = Engine.Localize( "@MENU_SWITCH_TO_SINGLE_PLAYER" ),
|
|
additional_handlers = {
|
|
dlc_mount_complete = UpdateRequiredDLCNotification,
|
|
dlc_mount_fail = UpdateRequiredDLCNotification,
|
|
dlc_download_fail = UpdateRequiredDLCNotification
|
|
}
|
|
}
|
|
}
|
|
end
|
|
|
|
function missing_content_error()
|
|
return {
|
|
type = "generic_yesno_popup",
|
|
id = "missing_content_error",
|
|
properties = {
|
|
popup_title = Engine.Localize( "@MENU_NOTICE" ),
|
|
message_text = ErrorRequiredDLC(),
|
|
message_text_alignment = LUI.Alignment.Left,
|
|
default_focus_index = 1,
|
|
yes_action = DownloadRequiredDLC,
|
|
no_action = StartSinglePlayerExe,
|
|
no_text = Engine.Localize( "@MENU_SWITCH_TO_SINGLE_PLAYER" )
|
|
}
|
|
}
|
|
end
|
|
|
|
function missing_content_downloading()
|
|
return {
|
|
type = "generic_confirmation_popup",
|
|
id = "missing_content_downloading",
|
|
properties = {
|
|
cancel_will_close = false,
|
|
confirmation_action = StartSinglePlayerExe,
|
|
message_text_alignment = LUI.Alignment.Left,
|
|
message_text = Engine.Localize( "LUA_MENU_MP_DOWNLOADING_REQUIRED_DLC" ),
|
|
button_text = Engine.Localize( "@MENU_SWITCH_TO_SINGLE_PLAYER" ),
|
|
popup_title = Engine.Localize( "MENU_NOTICE" )
|
|
},
|
|
handlers = {
|
|
dlc_mount_complete = UpdateRequiredDLCNotification,
|
|
dlc_mount_fail = UpdateRequiredDLCNotification,
|
|
dlc_download_fail = UpdateRequiredDLCNotification
|
|
}
|
|
}
|
|
end
|
|
|
|
function missing_content_discovery()
|
|
return {
|
|
type = "UIElement",
|
|
id = "missing_content_discovery",
|
|
children = {
|
|
{
|
|
type = "live_dialog_text_box",
|
|
id = "missing_content_discovery_popup",
|
|
properties = {
|
|
message = Engine.Localize( "LUA_MENU_MP_WAITING_REQUIRED_DLC" ),
|
|
dialog_width = 500
|
|
}
|
|
},
|
|
{
|
|
type = "UITimer",
|
|
id = "content_discovery_refresh_timer",
|
|
properties = {
|
|
event = {
|
|
name = "update_content_discovery"
|
|
},
|
|
interval = 3000
|
|
}
|
|
}
|
|
},
|
|
handlers = {
|
|
dlc_mount_complete = UpdateRequiredDLCNotification,
|
|
dlc_mount_fail = UpdateRequiredDLCNotification,
|
|
dlc_download_fail = UpdateRequiredDLCNotification,
|
|
update_content_discovery = UpdateRequiredDLCNotification
|
|
}
|
|
}
|
|
end
|
|
|
|
end
|
|
LUI.MenuBuilder.registerDef( "downloadingplaylist", downloadingplaylist )
|
|
LUI.MenuBuilder.registerDef( "menu_resetstats_warning", menu_resetstats_warning )
|
|
LUI.MenuBuilder.registerDef( "popup_gettingdata", popup_gettingdata )
|
|
LUI.MenuBuilder.registerDef( "popup_gettinglb", popup_gettinglb )
|
|
LUI.MenuBuilder.registerDef( "popup_getting_socialconfig", popup_getting_socialconfig )
|
|
LUI.MenuBuilder.registerDef( "popup_elite_sell", popup_elite_sell )
|
|
LUI.MenuBuilder.registerDef( "menu_xboxlive_partyended", menu_xboxlive_partyended )
|
|
LUI.MenuBuilder.registerDef( "error_popmenu_lobby", error_popmenu_lobby )
|
|
LUI.MenuBuilder.registerDef( "youarehost", youarehost )
|
|
LUI.MenuBuilder.registerDef( "partyinviteconfirm", partyinviteconfirm )
|
|
LUI.MenuBuilder.registerDef( "makehostfailed", makehostfailed )
|
|
LUI.MenuBuilder.registerDef( "savegame_error_mp", savegame_error_mp )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_popup_menu", cod_anywhere_popup_menu )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_error_popup_menu", cod_anywhere_error_popup_menu )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_working_popup_menu", cod_anywhere_working_popup_menu )
|
|
LUI.MenuBuilder.registerType( "cod_anywhere_success_popup_menu", cod_anywhere_success_popup_menu )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_link_ucd_popup_menu", cod_anywhere_link_ucd_popup_menu )
|
|
LUI.MenuBuilder.registerDef( "main_choose_exe_popup_menu", main_choose_exe_popup_menu )
|
|
LUI.MenuBuilder.registerDef( "acceptinvite_warning", acceptinvite_warning )
|
|
LUI.MenuBuilder.registerDef( "user_generated_content_restriction_popup", user_generated_content_restriction_popup )
|
|
LUI.MenuBuilder.registerDef( "copy_loadout_popup", copy_loadout_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_unavailable_popup", cod_anywhere_unavailable_popup )
|
|
LUI.MenuBuilder.registerDef( "cod_anywhere_all_done_popup_menu", cod_anywhere_all_done_popup_menu )
|
|
LUI.MenuBuilder.registerDef( "squad_challenge_invalid_popup", squad_challenge_invalid_popup )
|
|
LUI.MenuBuilder.registerDef( "mp_dlc_switch_searchtype", mp_dlc_switch_searchtype )
|
|
LUI.MenuBuilder.registerDef( "popup_throttling", popup_throttling )
|
|
LUI.MenuBuilder.registerDef( "mlg_error_no_rules_available_offline", mlg_error_no_rules_available_offline )
|
|
LUI.MenuBuilder.registerDef( "mlg_error_no_rules_available", mlg_error_no_rules_available )
|
|
LUI.MenuBuilder.registerDef( "mp_damaged_content_popup", mp_damaged_content_popup )
|
|
LUI.MenuBuilder.registerDef( "mp_no_guest_popup", mp_no_guest_popup )
|
|
if Engine.IsPS3() then
|
|
LUI.MenuBuilder.registerDef( "mp_wrong_controller_popup", mp_wrong_controller_popup )
|
|
end
|
|
if Engine.IsPS3() or Engine.IsPS4() then
|
|
LUI.MenuBuilder.registerDef( "mp_no_squad_assault", mp_no_squad_assault )
|
|
end
|
|
LUI.MenuBuilder.registerType( "jip_with_password", jip_with_password )
|
|
LUI.MenuBuilder.registerDef( "popup_no_guest", popup_no_guest )
|
|
LUI.MenuBuilder.registerDef( "popup_reset_game_options", popup_reset_game_options )
|
|
LUI.MenuBuilder.registerDef( "goto_store", goto_store )
|
|
LUI.MenuBuilder.registerDef( "finding_player_purchases", finding_player_purchases )
|
|
if Engine.IsXbox360() then
|
|
LUI.MenuBuilder.registerDef( "need_to_download_required_dlc", need_to_download_required_dlc )
|
|
LUI.MenuBuilder.registerDef( "currently_downloading_required_dlc", currently_downloading_required_dlc )
|
|
LUI.MenuBuilder.registerDef( "missing_content_downloading", missing_content_downloading )
|
|
LUI.MenuBuilder.registerDef( "missing_content_discovery", missing_content_discovery )
|
|
LUI.MenuBuilder.registerDef( "missing_content_signin", missing_content_signin )
|
|
LUI.MenuBuilder.registerDef( "missing_content_download", missing_content_download )
|
|
LUI.MenuBuilder.registerDef( "missing_content_error", missing_content_error )
|
|
end
|
|
LockTable( _M )
|