local f0_local0 = module local f0_local1, f0_local2 = ... f0_local0( f0_local1, package.seeall ) CoD.PrintModuleLoad( _NAME ) function readingsavedevice() return { type = "generic_popup_message", id = "readingsavedevice_id", properties = { message_text = Engine.Localize( "@PLATFORM_READING_SAVE_DEVICE" ) }, handlers = { menu_close = MBh.EmitEventToRoot( { name = "finish_read_device" } ) } } end f0_local0 = function ( f2_arg0, f2_arg1 ) local f2_local0 = Engine.GetDvarString( "com_errorTitle" ) local f2_local1 = Engine.GetDvarString( "com_errorMessage" ) local f2_local2 = { name = "update_title", title_text = f2_local0 } local f2_local3 = { name = "update_message", message_text = f2_local1 } f2_arg0:dispatchEventToChildren( f2_local2 ) f2_arg0:dispatchEventToChildren( f2_local3 ) local f2_local4 = Engine.GetLuiRoot() if f2_local4:IsMenuOpenAndVisible( "menu_splitscreensignin" ) then Engine.ExecNow( "incnosplitscreencontrol errorpopup" ) end end f0_local1 = function () Engine.ClearError( Engine.GetFirstActiveController() ) local f3_local0 = Engine.GetLuiRoot() if f3_local0:IsMenuOpenAndVisible( "menu_splitscreensignin" ) then Engine.ExecNow( "decnosplitscreencontrol errorpopup" ) end end function errorPopupClosePlus( f4_arg0, f4_arg1 ) if Engine.ShowPSPlusUpsell then Engine.ShowPSPlusUpsell( f4_arg1.controller ) end end function error_popmenu() return { type = "generic_confirmation_popup", id = "error_popup_id", handlers = { menu_create = f0_local0 } } end function error_popmenu_party() return { type = "generic_confirmation_popup", id = "error_popmenu_party_id", handlers = { menu_create = f0_local0 } } end function error_popmenu_psplus_party() return { type = "generic_confirmation_popup", id = "error_popmenu_party_plus_id", properties = { confirmation_action = errorPopupClosePlus }, handlers = { menu_create = f0_local0 } } end f0_local2 = function ( f8_arg0, f8_arg1 ) DebugPrint( "QUIT GAME NOW" ) Engine.Quit() end function quit_popmenu() return { type = "generic_yesno_popup", id = "quit_confirmation_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MENU_QUIT_WARNING" ), yes_action = f0_local2 } } end function error_popmenu_submenu() return { type = "generic_confirmation_popup", id = "error_popmenu_submenu_id", handlers = { menu_create = f0_local0 } } end local f0_local3 = function ( f11_arg0, f11_arg1 ) DebugPrint( "Applying video settings with restart..." ) if Engine.GetDvarString( "gameMode" ) == "sp" and not Engine.GetDvarBool( "sv_running" ) then if Engine.GetDvarInt( "ui_zfeather" ) == 1 then Engine.Exec( "set cg_laserLight 1" ) else Engine.Exec( "set cg_laserLight 0" ) end end Engine.ExecNow( "exec options_graphics_set.cfg" ) Engine.Exec( "wait; wait; r_applyPicmip" ) Engine.Exec( "setfromdvar snd_outputConfiguration ui_OutputConfig" ) Engine.Exec( "setfromdvar snd_enableEq ui_snd_enableEq" ) Engine.Exec( "snd_restart" ) Engine.Exec( "regeneratePlaylistPopulationImage" ) end local f0_local4 = function ( f12_arg0, f12_arg1 ) DebugPrint( "Applying video settings..." ) if Engine.GetDvarString( "gameMode" ) == "sp" and not Engine.GetDvarBool( "sv_running" ) then if Engine.GetDvarInt( "ui_zfeather" ) == 1 then Engine.Exec( "set cg_laserLight 1" ) else Engine.Exec( "set cg_laserLight 0" ) end end Engine.ExecNow( "exec options_graphics_set.cfg" ) end local f0_local5 = function ( f13_arg0, f13_arg1 ) DebugPrint( "No setting video settings..." ) Engine.ExecNow( "exec options_graphics.cfg" ) Engine.Exec( "setfromdvar ui_snd_enableEq\tsnd_enableEq" ) Engine.Exec( "setfromdvar ui_outputConfig\tsnd_outputConfiguration" ) Engine.SetOldLocalVarBool( f13_arg1.controller, "ui_showAudioApply", false ) Engine.SetOldLocalVarBool( f13_arg1.controller, "ui_showApply", false ) end local f0_local6 = function ( f14_arg0 ) local f14_local0 = {} if not Engine.InFrontend() then f14_local0[#f14_local0 + 1] = { type = "generic_menu_title", properties = { menu_title = Engine.Localize( "@LUA_MENU_PAUSED_CAPS" ) } } f14_local0[#f14_local0 + 1] = { type = "UIWorldBlur", id = "world_blur_id", states = { default = { worldBlur = 5 } } } end return f14_local0 end function apply_settings_restart_popmenu() return { type = "generic_yesno_popup", id = "apply_video_restart_popmenu_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_APPLY_SETTINGS" ), message_text = Engine.Localize( "@LUA_MENU_APPLY_SETTINGS_MESSAGE" ), yes_action = f0_local3, no_action = f0_local5 }, childrenFeeder = f0_local6 } end function apply_settings_popmenu() return { type = "generic_yesno_popup", id = "apply_video_popmenu_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_APPLY_SETTINGS" ), message_text = Engine.Localize( "@LUA_MENU_APPLY_SETTINGS_MESSAGE" ), yes_action = f0_local4, no_action = f0_local5 }, childrenFeeder = f0_local6 } end function show_low_texture_res_warning_restart_popmenu() return { type = "generic_yesno_popup", id = "show_low_texture_res_warning_restart_popmenu_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_APPLY_SETTINGS" ), message_text = Engine.Localize( "@MENU_VIDEO_SETTINGS_TEXTURE_WARNING" ), yes_action = f0_local3, no_action = f0_local5 }, childrenFeeder = f0_local6 } end function show_low_texture_res_warning_popmenu() return { type = "generic_yesno_popup", id = "show_low_texture_res_warning_popmenu_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_APPLY_SETTINGS" ), message_text = Engine.Localize( "@MENU_VIDEO_SETTINGS_TEXTURE_WARNING" ), yes_action = f0_local4, no_action = f0_local5 }, childrenFeeder = f0_local6 } end local f0_local7 = function ( f19_arg0, f19_arg1 ) Engine.Exec( "xsignin", f19_arg1.controller ) end local f0_local8 = function ( f20_arg0, f20_arg1 ) LUI.FlowManager.RequestAddMenu( f20_arg0, "boot_brightness", false, f20_arg1.controller, true, {} ) end function no_profile_warning_popmenu() return { type = "generic_yesno_popup", id = "no_profile_warning_popmenu_id", properties = { popup_title = Engine.Localize( "@MENU_WARNING" ), message_text = Engine.Localize( "@MENU_SP_PROFILE_WARNING_SP" ), yes_action = f0_local7, no_action = f0_local8 } } end local f0_local9 = function ( f22_arg0, f22_arg1 ) Engine.DeleteProfile( f22_arg1.controller ) Engine.Exec( "xsignin", f22_arg1.controller ) LUI.FlowManager.RequestAddMenu( f22_arg0, "boot_brightness", false, f22_arg1.controller, true, {} ) end function error_corrupt_savedata() return { type = "generic_confirmation_popup", id = "error_corrupt_savedata_id", properties = { cancel_will_close = false, popup_title = Engine.Localize( "@MENU_CORRUPT_SAVEDATA_TITLE" ), message_text = Engine.Localize( "@MENU_CORRUPT_SAVEDATA_MESSAGE" ), button_text = Engine.Localize( "@MENU_OK" ), confirmation_action = f0_local9 } } end local f0_local10 = function ( f24_arg0, f24_arg1 ) Engine.RetrySaveData( f24_arg1.controller ) end local f0_local11 = function ( f25_arg0, f25_arg1 ) Engine.ClearSaveDataErrors( f25_arg1.controller ) end function savedata_failed_popmenu() return { type = "generic_yesno_popup", id = "savedata_failed_popmenu_id", properties = { popup_title = Engine.Localize( "@MENU_SAVEDATA_FAILED_TITLE" ), message_text = Engine.Localize( "@MENU_SAVEDATA_FAILED_MESSAGE" ), yes_action = f0_local10, no_action = f0_local11 } } end function no_profile_force_popmenu() return { type = "generic_confirmation_popup", id = "no_profile_force_popmenu_id", properties = { popup_title = Engine.Localize( "@MENU_WARNING" ), message_text = Engine.Localize( "@LUA_MENU_PROFILE_FORCE_SP" ), button_text = Engine.Localize( "@MENU_OK" ) } } end function live_party_invite_popmenu() return { type = "generic_yesno_popup", id = "live_party_invite_popmenu_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@XBOXLIVE_PARTY_INVITE" ), yes_text = Engine.Localize( "@XBOXLIVE_PARTY_INVITE_ACCEPT_NOW" ), yes_action = function ( f29_arg0, f29_arg1 ) Friends.AcceptLivePartyInvitation( f29_arg1.controller ) end , no_text = Engine.Localize( "@XBOXLIVE_PARTY_INVITE_ACCEPT_LATER" ), no_action = function ( f30_arg0, f30_arg1 ) end } } end function sign_in_as_sub_or_guest() return { type = "generic_yesno_popup", id = "sign_in_as_sub_or_guest_id", properties = { popup_title = Engine.Localize( "@MENU_SIGN_IN_GUEST_OR_SUB_TITLE" ), message_text = Engine.Localize( "@MENU_SIGN_IN_GUEST_OR_SUB_TEXT" ), yes_text = Engine.Localize( "@MENU_SIGN_IN_GUEST_OR_SUB_YES" ), yes_action = function ( f32_arg0, f32_arg1 ) Lobby.DoSubSignIn( f32_arg1.controller ) end , no_text = Engine.Localize( "@MENU_SIGN_IN_GUEST_OR_SUB_NO" ), no_action = function ( f33_arg0, f33_arg1 ) Lobby.DoGuestSignIn( f33_arg1.controller ) end } } end function TryDisplayingAliensUnlockedPopup( f34_arg0 ) if Engine.IsAliensMode( f34_arg0 ) then Engine.Exec( "profile_SetKnowsAboutAliens", f34_arg0 ) return false end local f34_local0 = Engine.IsUserSignedIn( f34_arg0 ) and Engine.UnlockedAliens() and Engine.GetProfileData( "knowsAboutAliens", f34_arg0 ) == false if f34_local0 then LUI.FlowManager.RequestPopupMenu( self, "aliens_unlocked_popup", true, f34_arg0, nil, nil, nil, nil, false ) Engine.Exec( "profile_SetKnowsAboutAliens", f34_arg0 ) end return f34_local0 end function aliens_unlocked_popup() return { type = "generic_confirmation_popup", id = "aliens_unlocked_popup", properties = { popup_title = Engine.Localize( "MENU_NOTICE" ), message_text = Engine.Localize( "LUA_MENU_UNLOCKED_ALIENS" ) } } end function CancelAcceptingInvite( f36_arg0, f36_arg1 ) local f36_local0 = f36_arg1.controller Engine.SetDvarBool( "onlinegame", false ) Engine.SetDvarBool( "systemlink", false ) Engine.SetDvarBool( "specialops", false ) Engine.SetDvarBool( "so_survival", false ) Engine.Exec( "stopPrivateListen", f36_local0 ) Engine.Exec( "coopStopSearch", f36_local0 ) Engine.Exec( "useonlinestats 0", f36_local0 ) Engine.Exec( "statsdownloadcancel", f36_local0 ) Engine.Exec( "xstopparty WAITING_POPUP_CANCELED_ACTION", f36_local0 ) Engine.Exec( "xstopprivateparty", f36_local0 ) Engine.Exec( "xcancelconnectingdialog", f36_local0 ) Engine.Exec( "forcesplitscreencontrol WAITING_POPUP_CANCELED_ACTION", f36_local0 ) LUI.FlowManager.RequestLeaveMenu( f36_arg0 ) end function popup_acceptinginvite() return { type = "live_dialog_text_box_with_cancel", id = "popup_acceptinginvite_id", properties = { message = Engine.Localize( "@MENU_POPUP_ACCEPTINVITE" ), cancel_func = CancelAcceptingInvite } } end function UpdateTextDots( f38_arg0, f38_arg1 ) assert( f38_arg0.properties.numDots ) assert( f38_arg0.properties.message ) local f38_local0 = f38_arg0.properties.numDots local f38_local1 = f38_arg0.properties.message f38_local0 = (f38_local0 + 1) % 4 for f38_local2 = 1, f38_local0, 1 do local f38_local5 = f38_local2 f38_local1 = f38_local1 .. ". " end f38_arg0:setText( f38_local1 ) f38_arg0.properties.numDots = f38_local0 end function live_dialog_processing_widget() local f39_local0 = 1 local f39_local1 = 300 / 1.8 local f39_local2 = { alpha = 1, scale = -1 } local f39_local3 = { alpha = 1, scale = 0.4 } local f39_local4 = { alpha = 1, scale = 0 } local f39_local5 = { alpha = 0.25, scale = 0 } local f39_local6 = MBh.AnimateSequence( { { "state0", 0 / f39_local0 }, { "state1", 150 / f39_local0, true, true }, { "state2", 100 / f39_local0, true, true }, { "state3", 300 / f39_local0, true, true } } ) return { type = "UIElement", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -DialogWidgetDims.Width / 2, bottom = DialogWidgetDims.Width / 2, left = -DialogWidgetDims.Width / 2, right = DialogWidgetDims.Width / 2 } }, children = { { type = "UIImage", states = { default = { topAnchor = false, bottomAnchor = true, leftAnchor = false, rightAnchor = true, top = -16, bottom = 0, left = -16, right = 0, material = RegisterMaterial( "widg_loading_triangle" ), alpha = 0.25 }, state0 = f39_local2, state1 = f39_local3, state2 = f39_local4, state3 = f39_local5 }, handlers = { tick_0 = f39_local6 } }, { type = "UIImage", states = { default = { topAnchor = false, bottomAnchor = true, leftAnchor = true, rightAnchor = false, top = -16, bottom = 0, left = 16, right = 0, material = RegisterMaterial( "widg_loading_triangle" ), alpha = 0.25 }, state0 = f39_local2, state1 = f39_local3, state2 = f39_local4, state3 = f39_local5 }, handlers = { tick_1 = f39_local6 } }, { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 16, bottom = 0, left = 16, right = 0, material = RegisterMaterial( "widg_loading_triangle" ), alpha = 0.25 }, state0 = f39_local2, state1 = f39_local3, state2 = f39_local4, state3 = f39_local5 }, handlers = { tick_2 = f39_local6 } }, { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = false, rightAnchor = true, top = 16, bottom = 0, left = -16, right = 0, material = RegisterMaterial( "widg_loading_triangle" ), alpha = 0.25 }, state0 = f39_local2, state1 = f39_local3, state2 = f39_local4, state3 = f39_local5 }, handlers = { tick_3 = f39_local6 } }, { type = "UITimer", id = "spinner_timer", properties = { event = "anim_arrow", interval = f39_local1, disposable = false } }, { type = "UIElement", handlers = { anim_arrow = function ( f40_arg0, f40_arg1 ) f40_arg0.tick = f40_arg0.tick or 0 local f40_local0 = f40_arg0:getParent() f40_local0:processEvent( { name = "tick_" .. f40_arg0.tick } ) f40_arg0.tick = (f40_arg0.tick + 1) % 4 f40_arg0.tick = f40_arg0.tick and 0 or f40_arg0.tick end } } } } end function live_dialog_popup_background() return { type = "UIElement", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0, alpha = 1 }, hidden = { alpha = 0 } }, children = { { type = "generic_drop_shadow", properties = { offset_shadow = 0 } }, { type = "generic_menu_background", properties = { top_offset = 0, fill_alpha = 1 } } }, handlers = { hide_popup_background = MBh.AnimateToState( "hidden", 0 ) } } end function AddLiveDialogFooterHelperText( f42_arg0, f42_arg1 ) local f42_local0 = LUI.ButtonHelperText.helper_text_item( ButtonMap.button_secondary, Engine.Localize( "@LUA_MENU_CANCEL" ), nil, nil, nil ) f42_local0.triggers_event = "button_secondary" f42_local0.id = "popup_cancel_text_id" local f42_local1 = Engine.IsConsoleGame() if not f42_local1 then f42_local1 = Engine.IsGamepadEnabled() == 1 end local f42_local2 if f42_local1 then f42_local2 = 32 if not f42_local2 then else f42_local0:registerAnimationState( "default", { leftAnchor = false, rightAnchor = false, topAnchor = false, bottomAnchor = true, left = -50, right = 50, bottom = -4, height = f42_local2 } ) f42_local0:animateToState( "default" ) f42_local0:registerEventHandler( "virtual_keyboard_popup_active", MBh.EmitEvent( "popup_active" ) ) f42_arg0:addElement( f42_local0 ) end end f42_local2 = CoD.TextSettings.SmallFont.Height end function live_dialog_text_box_with_cancel() local f43_local0 = { type = "UIElement", properties = { message = "", indent = 15, cancel_func = function () end }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0 } } } local f43_local1 = {} local f43_local2 = { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0, material = RegisterMaterial( "white" ), red = 0.1, green = 0.14, blue = 0.16, alpha = 0.85 } } } local f43_local3 = { type = "UIElement", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -75, width = DialogPopupDims.Width, height = DialogPopupDims.Height } } } local f43_local4 = {} local f43_local5 = MBh.DoMultiple local f43_local6 = {} local f43_local7 = AddLiveDialogFooterHelperText local f43_local8 = MBh.EmitEvent( "reposition_elements" ) f43_local4.menu_create = f43_local5( f43_local7 ) f43_local4.reposition_elements = function ( f45_arg0, f45_arg1 ) local f45_local0 = 10 local f45_local1, f45_local2, f45_local3, f45_local4 = GetTextDimensions( f45_arg0.properties.message, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height ) local f45_local5 = f45_local3 - f45_local1 local f45_local6 = DialogWidgetDims.Width + f45_local0 + f45_local5 local f45_local7 = f45_arg0:getChildById( "popup_text_id" ) f45_local7:registerAnimationState( "updated", { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -CoD.TextSettings.NormalFont.Height, bottom = 0, left = -1 * (f45_local6 * 0.5 - DialogWidgetDims.Width + f45_local0), width = f45_local5 + f45_local0 } ) f45_local7:animateToState( "updated", 0 ) local f45_local8 = f45_arg0:getChildById( "popup_diamond_id" ) f45_local8:registerAnimationState( "updated", { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -26, left = -f45_local6 * 0.5, height = DialogWidgetDims.Height, width = DialogWidgetDims.Width } ) f45_local8:animateToState( "updated", 0 ) end f43_local3.handlers = f43_local4 f43_local3.children = { { type = "live_dialog_popup_background" }, { type = "UIText", id = "popup_text_id", properties = { message = MBh.Property( "message" ), text = MBh.Property( "message" ), indent = MBh.Property( "indent" ) }, states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -CoD.TextSettings.NormalFont.Height, bottom = 0, left = 0, right = 0, font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Left, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b } } }, { type = "live_dialog_processing_widget", id = "popup_diamond_id", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -26, width = DialogWidgetDims.Width, height = DialogWidgetDims.Height } } } } f43_local4 = { type = "UIBindButton", handlers = { button_secondary = function ( f46_arg0, f46_arg1 ) if f46_arg0.properties.cancel_func then f46_arg0.properties:cancel_func( f46_arg1 ) end end } } f43_local1[1] = f43_local2 f43_local1[2] = f43_local3 f43_local1[3] = f43_local4 f43_local0.children = f43_local1 return f43_local0 end function live_dialog_text_box() return { type = "UIElement", properties = { message = "", indent = 15, overlay_alpha = 0.85, top = -75, left = -DialogPopupDims.Width / 2 }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0 } }, children = { { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0, material = RegisterMaterial( "white" ), red = 0.1, green = 0.14, blue = 0.16, alpha = MBh.Property( "overlay_alpha" ) } } }, { type = "UIElement", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = MBh.Property( "top" ), left = MBh.Property( "left" ), width = DialogPopupDims.Width, height = DialogPopupDims.Height } }, handlers = { menu_create = MBh.EmitEvent( "reposition_elements" ), reposition_elements = function ( f48_arg0, f48_arg1 ) local f48_local0 = 10 local f48_local1, f48_local2, f48_local3, f48_local4 = GetTextDimensions( f48_arg0.properties.message, CoD.TextSettings.NormalFont.Font, CoD.TextSettings.NormalFont.Height ) local f48_local5 = f48_local3 - f48_local1 local f48_local6 = DialogWidgetDims.Width + f48_local0 + f48_local5 local f48_local7 = f48_arg0:getChildById( "popup_text_id" ) f48_local7:registerAnimationState( "updated", { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, height = CoD.TextSettings.NormalFont.Height, left = -1 * (f48_local6 * 0.5 - DialogWidgetDims.Width + f48_local0), width = f48_local5 + f48_local0 } ) f48_local7:animateToState( "updated", 0 ) local f48_local8 = f48_arg0:getChildById( "popup_diamond_id" ) f48_local8:registerAnimationState( "updated", { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, left = -f48_local6 * 0.5, height = DialogWidgetDims.Height, width = DialogWidgetDims.Width } ) f48_local8:animateToState( "updated", 0 ) end }, children = { { type = "live_dialog_popup_background" }, { type = "UIText", id = "popup_text_id", properties = { message = MBh.Property( "message" ), text = MBh.Property( "message" ), indent = MBh.Property( "indent" ) }, states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, left = 0, right = 0, height = CoD.TextSettings.NormalFont.Height, font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Left, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b } } }, { type = "live_dialog_processing_widget", id = "popup_diamond_id", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, width = DialogWidgetDims.Width, height = DialogWidgetDims.Height } } } } } } } end function live_multi_line_text_box() return { type = "UIElement", properties = { message = "", overlay_alpha = 0.85, dialog_width = DialogPopupDims.Width, dialog_height = DialogPopupDims.Height }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0 } }, children = { { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0, material = RegisterMaterial( "white" ), red = 0.1, green = 0.14, blue = 0.16, alpha = MBh.Property( "overlay_alpha" ) } } }, { type = "UIElement", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = MBh.HalfOppositeProperty( "dialog_height" ), left = MBh.HalfOppositeProperty( "dialog_width" ), width = MBh.Property( "dialog_width" ), height = MBh.Property( "dialog_height" ) } }, children = { { type = "live_dialog_popup_background" }, { type = "UIMarqueeText", id = "popup_text_id", properties = { message = MBh.Property( "message" ), text = MBh.Property( "message" ), useTextWrapping = true, textHeight = CoD.TextSettings.NormalFont.Height, dialog_height = MBh.Property( "dialog_height" ) }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 10, left = DialogWidgetDims.Width + 20, right = -10, bottom = -10, font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Left, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b } } }, { type = "live_dialog_processing_widget", id = "popup_diamond_id", states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = true, rightAnchor = false, left = 10, width = DialogWidgetDims.Width, height = DialogWidgetDims.Height } } } } } } } end function popup_connecting() return { type = "live_dialog_text_box_with_cancel", id = "popup_connecting_id", properties = { message = Engine.Localize( "@XBOXLIVE_POPUP_CONNECTION" ), cancel_func = LUI.common_menus.CommonPopups.CancelAcceptingInvite } } end local f0_local12 = function ( f51_arg0, f51_arg1 ) local f51_local0 = Engine.Localize( "@MENU_NOTICE" ) local f51_local1 = Engine.GetDvarString( "online_end_reason" ) f51_arg0:dispatchEventToChildren( { name = "update_title", title_text = f51_local0 } ) f51_arg0:dispatchEventToChildren( { name = "update_message", message_text = f51_local1 } ) end local f0_local13 = function ( f52_arg0, f52_arg1 ) Engine.ResolveError( f52_arg1.controller ) end function menu_online_ended() return { type = "generic_confirmation_popup", id = "menu_online_ended", properties = { confirmation_action = f0_local13 }, handlers = { menu_create = f0_local12 } } end local f0_local14 = function ( f54_arg0, f54_arg1 ) LUI.FlowManager.RequestCloseAllMenus( f54_arg0 ) Engine.TogglePause() f54_arg0:dispatchEventToRoot( { name = "toggle_pause_off" } ) end local f0_local15 = function ( f55_arg0, f55_arg1 ) LUI.FlowManager.RequestAddMenu( f55_arg0, "save_game_info_hud", true, f55_arg1.controller, false ) end local f0_local16 = function ( f56_arg0, f56_arg1 ) Engine.Exec( "disconnect" ) Engine.AcceptInvite() end function SaveGameErrorCreate( f57_arg0, f57_arg1 ) LUI.FlowManager.RequestLeaveMenuByName( "save_game_info_hud" ) end function SaveGameErrorFeeder( f58_arg0 ) local f58_local0 = Engine.GetDvarBool( "sv_saveDeviceAvailable" ) if not f58_local0 then f58_local0 = Engine.IsPS4() end local f58_local1 = Engine.IsXbox360() if f58_local1 then f58_local1 = Engine.GetDvarBool( "sv_saveGameAvailable" ) end local f58_local2 = {} local f58_local3 = "" if f58_local0 then if f58_local1 then f58_local3 = Engine.Localize( "@MENU_WARNING_CHECKPOINT_RESET" ) elseif Engine.IsPS4() then f58_local3 = Engine.Localize( "@PLATFORM_SAVE_ERROR" ) else f58_local3 = Engine.Localize( "@MENU_NO_SAVE_DEVICE_WARNING_NOW_OKAY" ) end else f58_local3 = Engine.Localize( "@MENU_NO_SAVE_DEVICE_WARNING" ) end f58_local2[#f58_local2 + 1] = { type = "UIText", id = "desc_text", states = { default = { font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Center, leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = CoD.TextSettings.NormalFont.Height, red = 1, green = 1, blue = 1 } }, properties = { text = f58_local3 } } local f58_local4 = "" if f58_local0 then if f58_local1 then f58_local4 = Engine.Localize( "@MENU_OVERWRITE_SAVE" ) else f58_local4 = Engine.Localize( "@MENU_RETRY_SAVE" ) end else f58_local4 = Engine.Localize( "@PLATFORM_SELECT_SAVE_DEVICE" ) end f58_local2[#f58_local2 + 1] = { type = "UIGenericButton", id = "first_button", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = f58_local4, button_action_func = function ( f59_arg0, f59_arg1 ) if f58_local0 then f0_local15( f59_arg0, f59_arg1 ) else Engine.ForceSelectSaveDevice( f59_arg1.controller ) if Engine.GetDvarBool( "sv_saveDeviceAvailable" ) then LUI.FlowManager.RequestLeaveMenu( f59_arg0 ) Engine.TogglePause() end end end } } f58_local2[#f58_local2 + 1] = { type = "UIGenericButton", id = "resume_game_nosave", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_RESUMEGAME_NOSAVE" ), button_action_func = function ( f60_arg0, f60_arg1 ) f0_local14( f60_arg0, f60_arg1 ) Engine.SaveRevert() end } } f58_local2[#f58_local2 + 1] = { type = "UIGenericButton", id = "quit_nosave", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_QUIT_NO_SAVE" ), button_action_func = function ( f61_arg0, f61_arg1 ) Engine.SaveRevert() LUI.FlowManager.RequestPopupMenu( f61_arg0, "quit_confirm_popup", false, f61_arg1.controller, false ) end } } if f58_local0 and not Engine.IsPS4() then f58_local2[#f58_local2 + 1] = { type = "UIGenericButton", id = "reselect_save_device", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@PLATFORM_RESELECT_SAVE_DEVICE" ), button_action_func = function ( f62_arg0, f62_arg1 ) Engine.ForceSelectSaveDevice( f62_arg1.controller ) end } } end return f58_local2 end function save_game_error_popup() local f63_local0 = Engine.GetDvarBool( "sv_saveDeviceAvailable" ) local f63_local1 = { type = "generic_selectionList_popup", id = "save_game_error_popup_id" } local f63_local2 = { cancel_will_close = false } local f63_local3 if f63_local0 then f63_local3 = Engine.Localize( "@PLATFORM_SAVE_ERROR_NOW_OKAY" ) if not f63_local3 then else f63_local2.popup_title = f63_local3 f63_local2.popup_childfeeder = SaveGameErrorFeeder f63_local1.properties = f63_local2 f63_local1.handlers = { menu_create = SaveGameErrorCreate } return f63_local1 end end f63_local3 = Engine.Localize( "@PLATFORM_SAVE_ERROR" ) end function LostSelectedSaveDevicePopupConfirm( f64_arg0, f64_arg1 ) Engine.Exec( "select_save_device" ) end function lost_selected_save_device_popup() return { type = "generic_confirmation_popup", id = "lost_selected_save_device_popup_id", properties = { message_text = Engine.Localize( "@PLATFORM_SAVE_DEVICE_LOST" ) }, handlers = { menu_close = LostSelectedSaveDevicePopupConfirm } } end local f0_local17 = function ( f66_arg0, f66_arg1 ) CoDAnywhere.IntegrateCACFile() end local f0_local18 = function ( f67_arg0, f67_arg1 ) CoDAnywhere.DeleteCACFile() end function cac_elite_popup() return { type = "generic_yesno_popup", id = "cac_elite_popup_id", properties = { popup_title = Engine.Localize( "@MENU_COD_MOBILE_APP_DATA_TITLE" ), squadMembersChanged = 1, loadoutsChanged = 2, modifiedDay = 1, modifiedMonth = 10, modifiedYear = 2013, message_text = Engine.GetDvarString( "mobile_app_data_available" ), yes_action = f0_local17, no_action = f0_local18, yes_text = Engine.Localize( "@MENU_YES" ), no_text = Engine.Localize( "@MENU_NO" ) } } end local f0_local19 = function ( f69_arg0, f69_arg1 ) Engine.Exec( "disconnect" ) end function quit_no_save_confirm_popup() return { type = "generic_yesno_popup", id = "quit_no_save_confirm_popup_id", properties = { popup_title = Engine.Localize( "@PLATFORM_QUIT" ), message_text = Engine.Localize( "@MENU_QUIT_WARNING" ), yes_action = f0_local19, yes_text = Engine.Localize( "@MENU_QUIT" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ) } } end function quit_confirm_popup() return { type = "generic_yesno_popup", id = "quit_confirm_popup_id", properties = { popup_title = Engine.Localize( "@PLATFORM_QUIT" ), message_text = Engine.Localize( "@MENU_ARE_YOU_SURE_QUIT" ), yes_action = f0_local19, yes_text = Engine.Localize( "@MENU_QUIT" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ) } } end function save_and_quit_confirm_popup() return { type = "generic_yesno_popup", id = "save_and_quit_confirm_popup_id", properties = { popup_title = Engine.Localize( "@MENU_QUIT_WARNING" ), message_text = Engine.Localize( "@MENU_SAVEQUIT_TEXT_1" ) .. Engine.Localize( "@MENU_SAVEQUIT_TEXT_2" ) .. Engine.Localize( "@MENU_SAVEQUIT_TEXT_3" ), yes_action = f0_local15, yes_text = Engine.Localize( "@CGAME_CONTINUE_SAVING" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ) } } end function save_and_quit_confirm_invited_popup() return { type = "generic_yesno_popup", id = "save_and_quit_confirm_invited_popup_id", properties = { popup_title = Engine.Localize( "@MENU_CONTINUE_SAVING" ), message_text = Engine.Localize( "@MENU_SAVEQUIT_TEXT_1" ) .. Engine.Localize( "@MENU_SAVEQUIT_TEXT_2" ) .. Engine.Localize( "@MENU_SAVEQUIT_TEXT_3" ), yes_action = f0_local15, no_action = f0_local16, yes_text = Engine.Localize( "@CGAME_CONTINUE_SAVING" ), no_text = Engine.Localize( "@MENU_CONTINUE_WITHOUT_SAVING" ) } } end local f0_local20 = function () return { type = "UIText", id = "save_game_loading_hud_id", properties = { text = Engine.Localize( "@CGAME_NOW_SAVING" ), textStyle = CoD.TextStyle.Shadowed }, states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = true, top = 80, bottom = 120, left = 0, right = 0, font = CoD.TextSettings.HudEuroNormalFont.Font, alignment = LUI.Alignment.Center, red = 1, green = 1, blue = 1 } } } end local f0_local21 = function ( f75_arg0, f75_arg1 ) Engine.SetSaveExecOnSuccess( "disconnect" ) Engine.SetDvarBool( "ui_skipMainLockout", true ) Engine.SaveDelay() Engine.WriteSave() end local f0_local22 = function ( f76_arg0, f76_arg1 ) if f76_arg1.finished then Engine.SaveComplete() end end local f0_local23 = function () return { type = "UIElement", id = "save_game_info_hud_id", states = { default = { topAnchor = true, leftAnchor = true, rightAnchor = true, botomAnchor = true } }, handlers = { menu_create = f0_local21, save_event = f0_local22 }, children = { { type = "UIOwnerdraw", id = "save_game_info_background", properties = { ownerDraw = CoD.Ownerdraw.CGMissionObjectiveBackdrop }, states = { default = { topAnchor = true, leftAnchor = true, bottomAnchor = true, rightAnchor = true, red = 0, green = 0, blue = 0, alpha = 0.5 } } }, { type = "UIText", id = "save_game_info_text", properties = { text = Engine.Localize( "@CGAME_NOW_SAVING" ), textStyle = CoD.TextStyle.Shadowed }, states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 80, bottom = 120, left = 150, font = CoD.TextSettings.ExtraBigFont.Font, alignment = LUI.Alignment.Center, red = 1, green = 1, blue = 1 } } } } } end local f0_local24 = function ( f78_arg0 ) return Engine.MarkLocalized( string.format( "%02d", f78_arg0 ) ) end local f0_local25 = function ( f79_arg0, f79_arg1 ) local f79_local0, f79_local1 = Engine.StreamingCheckInstall() if f79_local0 == nil then f79_local0 = 0 end local f79_local2 = f79_arg0:getFirstDescendentById( "middle" ) if f79_local2 ~= nil then f79_local2:registerAnimationState( "move_bar", { right = f79_local2.properties.m_maxWidth * f79_local0 } ) f79_local2:animateToState( "move_bar", 150 ) end if f79_local1 > 0 then local f79_local3 = f79_arg0:getFirstDescendentById( "streaming_install_seconds_remaining" ) if f79_local3 ~= nil then local f79_local4 = nil local f79_local5 = math.floor( f79_local1 / 3600 ) local f79_local6 = math.floor( f79_local1 / 60 - f79_local5 * 60 ) f79_local3:setText( Engine.Localize( "@MENU_SP_STREAMING_INSTALL_REMAINING", f0_local24( f79_local5 ), f0_local24( f79_local6 ), f0_local24( f79_local1 - f79_local6 * 60 - f79_local5 * 3600 ) ) ) end end end local f0_local26 = 104 local f0_local27 = 416 local f0_local28 = 26 local f0_local29 = 341 local f0_local30 = 416 local f0_local31 = 26 local f0_local32 = 26 local f0_local33 = function () return { type = "generic_selectionList_popup", id = "streaming_install_base_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MENU_SP_STREAMING_INSTALL" ), button_text = Engine.Localize( "@LUA_MENU_CANCEL" ), confirmation_action = MBh.LeaveMenu(), message_text_alignment = LUI.Alignment.Center, callback_params = {}, padding_top = 12, popup_childfeeder = function () return { { type = "UIText", id = "message_text_id", properties = { text = MBh.Property( "message_text" ), message_text_alignment = MBh.Property( "message_text_alignment" ) }, states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = true, top = 0, bottom = CoD.TextSettings.NormalFont.Height, left = 12, right = -12, alignment = MBh.Property( "message_text_alignment" ), font = CoD.TextSettings.NormalFont.Font, red = Colors.primary_text_color.r, green = Colors.primary_text_color.g, blue = Colors.primary_text_color.b } }, handlers = { update_message = setMessageText } }, { type = "UIElement", id = "spacer1", states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = 40 } } }, { type = "UIImage", id = "bar_bg", states = { default = { leftAnchor = false, rightAnchor = false, topAnchor = true, bottomAnchor = false, width = f0_local27, top = 0, bottom = f0_local26, red = 1, green = 1, blue = 1, alpha = 1, material = RegisterMaterial( "capturing_bg_mp" ) } }, children = { { type = "UIHorizontalList", id = "streaming_bar_hl", states = { default = { topAnchor = false, leftAnchor = true, bottomAnchor = true, rightAnchor = false, bottom = -53, left = 43, height = f0_local28, width = f0_local29, alignment = LUI.Alignment.Left, spacing = 0, alpha = 1 } }, children = { { type = "UIImage", id = "start_cap", states = { default = { topAnchor = true, leftAnchor = true, bottomAnchor = false, rightAnchor = false, top = 0, left = 0, height = f0_local28, width = f0_local32, red = Colors.cyan.r, green = Colors.cyan.g, blue = Colors.cyan.b, alpha = 1, material = RegisterMaterial( "capturing_bar_start_mp" ) } } }, { type = "UIImage", id = "middle", states = { default = { topAnchor = true, leftAnchor = true, bottomAnchor = false, rightAnchor = false, top = 0, left = 0, height = f0_local28, width = 0, red = Colors.cyan.r, green = Colors.cyan.g, blue = Colors.cyan.b, alpha = 1, material = RegisterMaterial( "capturing_bar_mp" ) } }, properties = { m_maxWidth = f0_local29 - f0_local32 - f0_local32 } }, { type = "UIImage", id = "end_cap", states = { default = { topAnchor = true, rightAnchor = true, top = 0, right = 0, height = f0_local28, width = f0_local32, red = Colors.cyan.r, green = Colors.cyan.g, blue = Colors.cyan.b, alpha = 1, material = RegisterMaterial( "capturing_bar_end_mp" ) } } } } } } }, { type = "UIText", id = "streaming_install_seconds_remaining", states = { default = { font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Center, leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = CoD.TextSettings.NormalFont.Height, red = 1, green = 1, blue = 1 } }, properties = { text = "" } }, { type = "UIGenericButton", id = "exit_button_id", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = MBh.Property( "button_text" ), confirmation_action = MBh.Property( "confirmation_action" ), button_action_func = function ( f82_arg0, f82_arg1 ) f82_arg0.properties:confirmation_action( f82_arg1 ) LUI.FlowManager.RequestLeaveMenu( f82_arg0 ) end , callback_params = MBh.Property( "callback_params" ) } } } end }, children = { { type = "UITimer", id = "streaming_install_timer", properties = { event = "refresh_streaming_install_progress", interval = 500, disposable = false } } }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, left = 0, right = 0, top = 0, bottom = 0 } }, handlers = { menu_create = SetupStreamingInstallRefreshTimer, refresh_streaming_install_progress = f0_local25 } } end local f0_local34 = function () return { type = "streaming_install_base", properties = { button_text = Engine.Localize( "@LUA_MENU_BACK" ), confirmation_action = MBh.LeaveMenu() } } end local f0_local35 = function () return { type = "streaming_install_base", properties = { cancel_will_close = false, button_text = Engine.Localize( "@MENU_MAIN_MENU" ), confirmation_action = function ( f85_arg0, f85_arg1 ) if Engine.IsSaveAvailable() then f0_local15( f85_arg0, f85_arg1 ) else f0_local19( f85_arg0, f85_arg1 ) end end } } end function menu_ps3_ui_bg() return { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0, material = RegisterMaterial( "white" ), red = 0.1, green = 0.14, blue = 0.16, alpha = 0.85 } } } end local f0_local36 = function ( f87_arg0, f87_arg1 ) local f87_local0 = Engine.GetLuiRoot() Engine.ExecNow( "profile_toggleEnableGamepad" ) LUI.FlowManager.tryAddMouseCursor( f87_local0 ) Engine.Exec( "updategamerprofile" ) end if Engine.IsConsoleGame() then function controllerremoved_popmenu() return { type = "generic_popup_message", id = "controller_removed_id", properties = { message_text = Engine.Localize( "@PLATFORM_CONTROLLER_DISCONNECTED" ) } } end else function controllerremoved_popmenu() return { type = "generic_confirmation_popup", id = "controller_removed_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@PLATFORM_CONTROLLER_DISCONNECTED" ), button_text = Engine.Localize( "@MENU_SWITCH_TO_MOUSE" ), confirmation_action = f0_local36 } } end end if not Engine.IsConsoleGame() then function steam_overlay_required() return { type = "generic_confirmation_popup", id = "steam_overlay_required_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@PLATFORM_UI_STEAM_OVERLAY_REQUIRED" ) } } end end function ConfirmProfileChange( f91_arg0, f91_arg1 ) DebugPrint( "Confirm profile change" ) Engine.ConfirmXB3UserProfileChange( f91_arg1.controller ) LUI.FlowManager.RequestLeaveMenu( f91_arg0 ) end function IgnoreProfileChange( f92_arg0, f92_arg1 ) DebugPrint( "Ignore profile change" ) Engine.IgnoreXB3UserProfileChange( f92_arg1.controller ) LUI.FlowManager.RequestLeaveMenu( f92_arg0 ) end function user_changed_confirm_mp() return { type = "generic_yesno_popup", properties = { message_text = Engine.Localize( "@MENU_PROFILE_PAIRING_CONFIRM" ), popup_title = Engine.Localize( "@MENU_WARNING" ), yes_text = Engine.Localize( "@MENU_YES" ), no_text = Engine.Localize( "@MENU_NO" ), yes_action = IgnoreProfileChange, no_action = ConfirmProfileChange, default_focus_index = 1 } } end function controller_changed_confirm_mp() return { type = "generic_confirmation_popup", properties = { message_text = Engine.Localize( "@MENU_CONTROLLER_PAIRING_CONFIRM" ), popup_title = Engine.Localize( "@MENU_WARNING" ) } } end function updating_squad_reports() return { type = "UIElement", id = "updating_squad_reports_id", handlers = { finish_report_update = MBh.LeaveMenu() }, children = { { type = "live_dialog_text_box", id = "live_dialog_text_box_id", properties = { message = Engine.Localize( "LUA_MENU_UPDATING_REPORTS" ) } }, { type = "UITimer", id = "updating_squad_reports_timer", properties = { event = "finish_report_update", interval = 1500 } } } } end function recipe_load_failed_popup() return { type = "generic_confirmation_popup", id = "recipe_load_failed_popup_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MPUI_RECIPE_LOAD_FAILED" ) } } end function recipe_save_failed_popup() return { type = "generic_confirmation_popup", id = "recipe_save_failed_popup_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MPUI_RECIPE_SAVE_FAILED" ) } } end function recipe_save_failed_no_guests_popup() return { type = "generic_confirmation_popup", id = "recipe_save_failed_no_guests_popup_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MPUI_RULES_NOGUESTSAVE" ) } } end function recipe_save_failed_no_device_popup() return { type = "generic_confirmation_popup", id = "recipe_save_failed_no_device_popup_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MPUI_RULES_NOSAVEDEVICE" ) } } end function no_controller_initial_popup() return { type = "generic_yesno_popup", id = "no_controller_initial_popup_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MENU_NO_CONTROLLER_INITIAL" ), yes_action = f0_local36 } } end local f0_local37 = function ( f101_arg0, f101_arg1 ) Engine.ExecNow( "profile_toggleEnableGamepad 1" ) Engine.ExecNow( "updategamerprofile" ) f101_arg0:dispatchEventToRoot( { name = "refresh_button_helper", dispatchChildren = true } ) f101_arg0:dispatchEventToRoot( { name = "refresh_button_background" } ) end local f0_local38 = function ( f102_arg0, f102_arg1 ) Engine.ExecNow( "profile_toggleEnableGamepad 0" ) Engine.ExecNow( "updategamerprofile" ) end function controller_initial_popup() return { type = "generic_yesno_popup", id = "controller_initial_popup_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@MENU_CONTROLLER_INITIAL" ), yes_action = f0_local37, no_action = f0_local38 } } end if Engine.IsXbox360() then function required_dlc_download_initiated() return { type = "generic_confirmation_popup", id = "required_dlc_download_initiated", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@LUA_MENU_REQUIRED_DLC_DOWNLOAD_INITIATED" ), button_text = Engine.Localize( "@MENU_OK" ) } } end function required_dlc_download_failed() return { type = "generic_confirmation_popup", id = "required_dlc_download_failed", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@LUA_MENU_REQUIRED_DLC_DOWNLOAD_FAILED" ), button_text = Engine.Localize( "@MENU_OK" ) } } end end LUI.MenuBuilder.registerDef( "live_dialog_text_box_with_cancel", live_dialog_text_box_with_cancel ) LUI.MenuBuilder.registerDef( "live_dialog_text_box", live_dialog_text_box ) LUI.MenuBuilder.registerDef( "live_multi_line_text_box", live_multi_line_text_box ) LUI.MenuBuilder.registerDef( "live_dialog_processing_widget", live_dialog_processing_widget ) LUI.MenuBuilder.registerDef( "live_dialog_popup_background", live_dialog_popup_background ) LUI.MenuBuilder.registerDef( "error_popmenu_party", error_popmenu_party ) LUI.MenuBuilder.registerDef( "error_popmenu_psplus_party", error_popmenu_psplus_party ) LUI.MenuBuilder.registerDef( "live_party_invite_popmenu", live_party_invite_popmenu ) LUI.MenuBuilder.registerDef( "sign_in_as_sub_or_guest", sign_in_as_sub_or_guest ) LUI.MenuBuilder.registerDef( "aliens_unlocked_popup", aliens_unlocked_popup ) LUI.MenuBuilder.registerDef( "popup_acceptinginvite", popup_acceptinginvite ) LUI.MenuBuilder.registerDef( "popup_connecting", popup_connecting ) LUI.MenuBuilder.registerDef( "error_popmenu_submenu", error_popmenu_submenu ) LUI.MenuBuilder.registerDef( "readingsavedevice", readingsavedevice ) LUI.MenuBuilder.registerDef( "error_corrupt_savedata", error_corrupt_savedata ) LUI.MenuBuilder.registerDef( "savedata_failed_popmenu", savedata_failed_popmenu ) LUI.MenuBuilder.registerDef( "error_popmenu", error_popmenu ) LUI.MenuBuilder.registerDef( "quit_popmenu", quit_popmenu ) LUI.MenuBuilder.registerDef( "apply_settings_popmenu", apply_settings_popmenu ) LUI.MenuBuilder.registerDef( "apply_settings_restart_popmenu", apply_settings_restart_popmenu ) LUI.MenuBuilder.registerDef( "show_low_texture_res_warning_restart_popmenu", show_low_texture_res_warning_restart_popmenu ) LUI.MenuBuilder.registerDef( "show_low_texture_res_warning_popmenu", show_low_texture_res_warning_popmenu ) LUI.MenuBuilder.registerDef( "no_profile_warning_popmenu", no_profile_warning_popmenu ) LUI.MenuBuilder.registerDef( "no_profile_force_popmenu", no_profile_force_popmenu ) LUI.MenuBuilder.registerDef( "quit_no_save_confirm_popup", quit_no_save_confirm_popup ) LUI.MenuBuilder.registerDef( "quit_confirm_popup", quit_confirm_popup ) LUI.MenuBuilder.registerDef( "save_and_quit_confirm_popup", save_and_quit_confirm_popup ) LUI.MenuBuilder.registerDef( "save_and_quit_confirm_invited_popup", save_and_quit_confirm_invited_popup ) LUI.MenuBuilder.registerDef( "save_game_error_popup", save_game_error_popup ) LUI.MenuBuilder.registerDef( "lost_selected_save_device_popup", lost_selected_save_device_popup ) LUI.MenuBuilder.registerDef( "save_game_loading_hud", f0_local20 ) LUI.MenuBuilder.registerDef( "save_game_info_hud", f0_local23 ) LUI.MenuBuilder.registerDef( "streaming_install_base", f0_local33 ) LUI.MenuBuilder.registerDef( "streaming_install_frontend", f0_local34 ) LUI.MenuBuilder.registerDef( "streaming_install_ingame", f0_local35 ) LUI.MenuBuilder.registerDef( "menu_ps3_ui_bg", menu_ps3_ui_bg ) LUI.MenuBuilder.registerDef( "menu_online_ended", menu_online_ended ) LUI.MenuBuilder.registerDef( "controllerremoved_popmenu", controllerremoved_popmenu ) LUI.MenuBuilder.registerDef( "user_changed_confirm_mp", user_changed_confirm_mp ) LUI.MenuBuilder.registerDef( "controller_changed_confirm_mp", controller_changed_confirm_mp ) LUI.MenuBuilder.registerDef( "cac_elite_popup", cac_elite_popup ) LUI.MenuBuilder.registerDef( "updating_squad_reports", updating_squad_reports ) LUI.MenuBuilder.registerDef( "recipe_load_failed_popup", recipe_load_failed_popup ) LUI.MenuBuilder.registerDef( "recipe_save_failed_popup", recipe_save_failed_popup ) LUI.MenuBuilder.registerDef( "recipe_save_failed_no_guests_popup", recipe_save_failed_no_guests_popup ) LUI.MenuBuilder.registerDef( "recipe_save_failed_no_device_popup", recipe_save_failed_no_device_popup ) LUI.MenuBuilder.registerDef( "no_controller_initial_popup", no_controller_initial_popup ) LUI.MenuBuilder.registerDef( "controller_initial_popup", controller_initial_popup ) if not Engine.IsConsoleGame() then LUI.MenuBuilder.registerDef( "steam_overlay_required", steam_overlay_required ) end LUI.FlowManager.RegisterStackPopBehaviour( "error_popmenu", f0_local1 ) LUI.FlowManager.RegisterStackPopBehaviour( "error_popmenu_party", f0_local1 ) LUI.FlowManager.RegisterStackPopBehaviour( "error_popmenu_submenu", f0_local1 ) LUI.FlowManager.RegisterStackPopBehaviour( "error_popmenu_psplus_party", f0_local1 ) if Engine.IsXbox360() then LUI.MenuBuilder.registerDef( "required_dlc_download_initiated", required_dlc_download_initiated ) LUI.MenuBuilder.registerDef( "required_dlc_download_failed", required_dlc_download_failed ) end LockTable( _M )