local f0_local0 = module local f0_local1, f0_local2 = ... f0_local0( f0_local1, package.seeall ) CoD.PrintModuleLoad( _NAME ) FileTypes = { All = 0, Film = 1, Clip = 2, Screenshot = 3, AVI = 4, CustomGame = 5, RCU = 6, FB_AVI = 7 } VaultNotifications = { Copy = 0, Update = 1, Delete = 2, LoadMode = 3, SaveMode = 4 } function OnCreate( f1_arg0, f1_arg1 ) local f1_local0 = f1_arg1.controller if not f1_local0 then f1_local0 = Engine.GetFirstActiveController() end OnlineVault.Open( f1_local0, "" .. f1_arg0.properties.vaultMode .. " " .. f1_arg0.properties.vaultCategory .. " " .. "invalid" ) if OnlineVault.GetSlotCount( f1_local0 ) < 1 then LUI.FlowManager.RequestPopupMenu( f1_arg0, "online_vault_fetching_popup", true, f1_local0, false ) end f1_arg0:dispatchEventToRoot( { name = "vault_refresh", dispatchChildren = true, immediate = true } ) f1_arg0:dispatchEventToRoot( { name = "add_button_helper_text", button_ref = "button_secondary", helper_text = Engine.Localize( "@LUA_MENU_BACK" ), side = "left", clickable = true, immediate = true } ) f1_arg0:dispatchEventToRoot( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = Engine.Localize( "@MENU_FRIENDS" ), side = "right", clickable = true } ) end function VaultItemDisabled( f2_arg0, f2_arg1 ) local f2_local0 = f2_arg1.controller if not f2_local0 then f2_local0 = Engine.GetFirstActiveController() end return not OnlineVault.IsItemEnabled( f2_local0, f2_arg1.slot_index ) end function LeaveVault( f3_arg0, f3_arg1 ) local f3_local0 = f3_arg1.controller if not f3_local0 then f3_local0 = Engine.GetFirstActiveController() end OnlineVault.Close( f3_local0, true ) if f3_arg1 and f3_arg1.restoreMenu then LUI.FlowManager.RequestRestoreMenu( f3_arg0, f3_arg1.restoreMenu, true, f3_arg1.controller, true ) else LUI.FlowManager.RequestLeaveMenu( f3_arg0 ) end end function OnActionButton( f4_arg0, f4_arg1 ) local f4_local0 = f4_arg1.vaultMode local f4_local1 = f4_arg1.idx if f4_local0 == "browse" then HandleBrowseSelection( f4_arg0, f4_arg1.controller, f4_local1 ) elseif f4_local0 == "load" then OnlineVault.LoadItem( f4_arg1.controller, f4_local1 ) LUI.FlowManager.RequestPopupMenu( f4_arg0, "online_vault_please_wait_popup", true, controller, false ) elseif f4_local0 == "save" then if OnlineVault.IsValidSlot( f4_arg1.controller, f4_local1 ) then LUI.FlowManager.RequestPopupMenu( f4_arg0, "online_vault_confirm_overwrite_popup", true, f4_arg1.controller, false, { callback_params = { saveToSlot = f4_local1 } } ) else OnlineVault.Save( f4_arg1.controller, f4_local1 ) LUI.FlowManager.RequestPopupMenu( f4_arg0, "online_vault_please_wait_popup", true, controller, false ) end elseif f4_local0 == "copy" then else DebugPrint( "Button pressed during unknown vault mode! Ignoring... " ) end end function HandleBrowseSelection( f5_arg0, f5_arg1, f5_arg2 ) local f5_local0 = OnlineVault.GetItemFiletype( f5_arg1 or Engine.GetFirstActiveController(), f5_arg2 ) local f5_local1 = { callback_params = { slotIndex = f5_arg2 } } local f5_local2 = "" if f5_local0 == FileTypes.Film then f5_local2 = "online_vault_browse_film_popup" elseif f5_local0 == FileTypes.Clip then f5_local2 = "online_vault_browse_clip_popup" elseif f5_local0 == FileTypes.Screenshot then f5_local2 = "online_vault_browse_screenshot_popup" elseif f5_local0 == FileTypes.CustomGame then f5_local2 = "online_vault_browse_cgm_popup" else DebugPrint( "OnlineVault browse selection of unknown type!" ) end if f5_local2 ~= "" then LUI.FlowManager.RequestPopupMenu( f5_arg0, f5_local2, true, f5_arg1, false, f5_local1 ) end end function UpdateSelection( f6_arg0, f6_arg1 ) local f6_local0 = f6_arg1.controller if not f6_local0 then f6_local0 = Engine.GetFirstActiveController() end local f6_local1 = f6_arg1.idx local f6_local2 = LUI.FlowManager.GetMenuScopedDataFromElement( f6_arg0 ) local f6_local3 = f6_local2.itemType local f6_local4 = OnlineVault.GetItemFiletype( f6_local0, f6_local1 ) if f6_local3 == nil or f6_local3 ~= f6_local4 then f6_local2.itemType = f6_local4 f6_arg0:dispatchEventToRoot( { name = "refresh_details", dispatchChildren = true, immediate = true } ) end local f6_local5 = OnlineVault.GetItemText( f6_local0, f6_local1 ) local f6_local6 = OnlineVault.GetItemData( f6_local0, f6_local1, "author" ) local f6_local7 = OnlineVault.GetItemData( f6_local0, f6_local1, "desc" ) local f6_local8 = OnlineVault.GetItemData( f6_local0, f6_local1, "gametype" ) local f6_local9 = OnlineVault.GetItemData( f6_local0, f6_local1, "map" ) local f6_local10 = OnlineVault.GetItemData( f6_local0, f6_local1, "duration" ) local f6_local11 = OnlineVault.GetItemData( f6_local0, f6_local1, "createTime" ) local f6_local12 if f6_local4 == FileTypes.CustomGame then f6_local12 = "icon_playlist_generic" if not f6_local12 then else f6_arg0:dispatchEventToRoot( { name = "update_details", dispatchChildren = true, immediate = true, title = f6_local5, creator = f6_local6, desc = f6_local7, baseMode = f6_local8, map = f6_local9, duration = f6_local10, timestamp = f6_local11, image = f6_local12 } ) end end f6_local12 = OnlineVault.GetItemData( f6_local0, f6_local1, "mapImage" ) end function DoRefresh( f7_arg0, f7_arg1 ) f7_arg0:closeChildren() f7_arg0:clearSavedState() f7_arg0:processEvent( { name = "menu_refresh", dispatchChildren = true } ) end function CancelFetch( f8_arg0, f8_arg1 ) OnlineVault.AbortOperation( f8_arg1.controller ) LUI.FlowManager.RequestLeaveMenu( f8_arg0 ) f8_arg0:dispatchEventToRoot( { name = "leave_vault", dispatchChildren = true, immediate = true } ) end function HandleVaultNotification( f9_arg0, f9_arg1 ) local f9_local0 = f9_arg1.type if f9_local0 == VaultNotifications.Copy then elseif f9_local0 == VaultNotifications.Delete then HandleDeleteResult( f9_arg0, f9_arg1 ) elseif f9_local0 == VaultNotifications.LoadMode then HandleModeLoadResult( f9_arg0, f9_arg1 ) elseif f9_local0 == VaultNotifications.SaveMode then HandleModeSaveResult( f9_arg0, f9_arg1 ) else DebugPrint( "OnlineVault got notification message with unknown type " .. f9_local0 ) end end function HandleModeLoadResult( f10_arg0, f10_arg1 ) if not f10_arg1.controller then local f10_local0 = Engine.GetFirstActiveController() end if f10_arg1.success then LUI.FlowManager.RequestPopupMenu( f10_arg0, "online_vault_load_mode_success_popup", true, f10_arg1.controller, true ) else LUI.FlowManager.RequestPopupMenu( f10_arg0, "online_vault_load_mode_fail_popup", true, f10_arg1.controller, true ) end end function HandleModeSaveResult( f11_arg0, f11_arg1 ) if not f11_arg1.controller then local f11_local0 = Engine.GetFirstActiveController() end local f11_local1 = f11_arg1.success local f11_local2 = nil if f11_local1 then f11_local2 = Engine.Localize( "@MENU_CGM_SAVE_SUCCESS" ) else f11_local2 = Engine.Localize( "@MENU_CGM_SAVE_FAILED" ) end LUI.FlowManager.RequestPopupMenu( f11_arg0, "online_vault_save_mode_result_popup", true, f11_arg1.controller, true, { message_text = f11_local2 } ) end function HandleDeleteResult( f12_arg0, f12_arg1 ) if not f12_arg1.controller then local f12_local0 = Engine.GetFirstActiveController() end if f12_arg1.success then LUI.FlowManager.RequestPopupMenu( f12_arg0, "online_vault_delete_success_popup", true, f12_arg1.controller, true ) else LUI.FlowManager.RequestPopupMenu( f12_arg0, "online_vault_delete_fail_popup", true, f12_arg1.controller, true ) end end function SaveVaultItem( f13_arg0, f13_arg1 ) OnlineVault.Save( f13_arg1.controller, f13_arg0.properties.callback_params.saveToSlot ) LUI.FlowManager.RequestPopupMenu( f13_arg0, "online_vault_please_wait_popup", true, controller, false ) end function ViewScreenshot( f14_arg0, f14_arg1 ) local f14_local0 = f14_arg1.controller if not f14_local0 then f14_local0 = Engine.GetFirstActiveController() end local f14_local1 = f14_arg0.properties.callback_params.slotIndex LUI.FlowManager.RequestLeaveMenu( f14_arg0 ) f14_arg0:dispatchEventToRoot( { name = "open_screenshot_viewer", controller = f14_local0, slotIndex = f14_local1, dispatchChildren = true, immediate = false } ) end function OpenScreenshotViewer( f15_arg0, f15_arg1 ) local f15_local0 = f15_arg1.controller if not f15_local0 then f15_local0 = Engine.GetFirstActiveController() end OnlineVault.LoadItem( f15_local0, f15_arg1.slotIndex ) end function DoDeleteConfirm( f16_arg0, f16_arg1 ) local f16_local0 = f16_arg1.controller if not f16_local0 then f16_local0 = Engine.GetFirstActiveController() end LUI.FlowManager.RequestPopupMenu( f16_arg0, "online_vault_confirm_delete_popup", true, f16_local0, true, { callback_params = { deleteSlot = f16_arg0.properties.callback_params.slotIndex } } ) end function OnConfirmDelete( f17_arg0, f17_arg1 ) local f17_local0 = f17_arg1.controller if not f17_local0 then f17_local0 = Engine.GetFirstActiveController() end local f17_local1 = f17_arg0.properties.callback_params.deleteSlot LUI.FlowManager.RequestPopupMenu( f17_arg0, "online_vault_please_wait_popup", true, f17_local0, false ) OnlineVault.DeleteItem( f17_local0, f17_local1 ) end function VaultEntryFeeder( f18_arg0 ) local f18_local0 = {} local f18_local1 = f18_arg0.controller if not f18_local1 then f18_local1 = Engine.GetFirstActiveController() end local f18_local2 = OnlineVault.GetSlotCount( f18_local1 ) for f18_local3 = 0, f18_local2 - 1, 1 do local f18_local6 = OnlineVault.GetItemText( f18_local1, f18_local3 ) local f18_local7 = OnlineVault.GetItemIcon( f18_local1, f18_local3 ) if f18_local6 == "" then f18_local6 = Engine.Localize( "@MPUI_EMPTY" ) end f18_local0[#f18_local0 + 1] = { type = "online_vault_entry_widget", id = "vault_entry_" .. f18_local3, disabledFunc = VaultItemDisabled, properties = { slot_index = f18_local3, index_text = f18_local3 + 1, button_text = f18_local6, type_image = RegisterMaterial( f18_local7 ) }, handlers = { button_action = MBh.EmitEventToRoot( { name = "select_item", controller = f18_local1, vaultMode = f18_arg0.vaultMode, idx = f18_local3 } ), button_disable = MBh.AnimateToState( "disabled", 0 ), button_over = MBh.EmitEventToRoot( { name = "update_selection", vaultMode = f18_arg0.vaultMode, idx = f18_local3 } ), button_over_disable = MBh.EmitEventToRoot( { name = "update_selection", savedMode = f18_arg0.savedMode, idx = f18_local3 } ) } } end return f18_local0 end function DetailTextFactory( f19_arg0, f19_arg1, f19_arg2, f19_arg3, f19_arg4 ) return { type = "online_vault_details_text", id = f19_arg0, properties = { label_text = f19_arg1 or "", value_text = f19_arg2 or "", label_update_func = f19_arg3, value_update_func = f19_arg4 } } end function GameModeDetailsFeeder( f20_arg0 ) local f20_local0 = {} local f20_local1 = {} local f20_local2 = "online_vault_detail_creator_id" local f20_local3 = Engine.Localize( "@MPUI_VAULT_CREATOR" ) local f20_local4, f20_local5 = nil local f20_local6 = function ( f21_arg0, f21_arg1 ) f21_arg0:setText( f21_arg1.creator ) end f20_local1[1] = f20_local2 f20_local1[2] = f20_local3 f20_local1[3] = f20_local4 f20_local1[4] = f20_local5 f20_local1[5] = f20_local6 f20_local2 = {} f20_local3 = "online_vault_detail_desc_label_id" f20_local4 = Engine.Localize( "@MPUI_VAULT_DESCRIPTION" ) local f20_local5, f20_local6, f20_local7 = nil f20_local2[1] = f20_local3 f20_local2[2] = f20_local4 f20_local2[3] = f20_local5 f20_local2[4] = f20_local6 f20_local2[5] = f20_local7 f20_local3 = {} f20_local4 = "online_vault_detail_desc_value_id" f20_local5, f20_local6 = nil f20_local7 = function ( f22_arg0, f22_arg1 ) f22_arg0:setText( f22_arg1.desc ) end local f20_local8 = nil f20_local3[1] = f20_local4 f20_local3[2] = f20_local5 f20_local3[3] = f20_local6 f20_local3[4] = f20_local7 f20_local3[5] = f20_local8 f20_local4 = {} f20_local5 = "online_vault_detail_blank_id" local f20_local6, f20_local7, f20_local8, f20_local9 = nil f20_local4[1] = f20_local5 f20_local4[2] = f20_local6 f20_local4[3] = f20_local7 f20_local4[4] = f20_local8 f20_local4[5] = f20_local9 f20_local5 = {} f20_local6 = "online_vault_detail_base_mode_id" f20_local7 = Engine.Localize( "@MPUI_VAULT_BASEGAMEMODE" ) f20_local8, f20_local9 = nil local f20_local10 = function ( f23_arg0, f23_arg1 ) f23_arg0:setText( f23_arg1.baseMode ) end f20_local5[1] = f20_local6 f20_local5[2] = f20_local7 f20_local5[3] = f20_local8 f20_local5[4] = f20_local9 f20_local5[5] = f20_local10 f20_local0[1] = f20_local1 f20_local0[2] = f20_local2 f20_local0[3] = f20_local3 f20_local0[4] = f20_local4 f20_local0[5] = f20_local5 f20_local1 = {} for f20_local5, f20_local6 in pairs( f20_local0 ) do f20_local1[f20_local5] = DetailTextFactory( f20_local6[1], f20_local6[2], f20_local6[3], f20_local6[4], f20_local6[5] ) end return f20_local1 end function ScreenshotDetailsFeeder( f24_arg0 ) local f24_local0 = {} local f24_local1 = {} local f24_local2 = "online_vault_detail_creator_id" local f24_local3 = Engine.Localize( "@MPUI_VAULT_CREATOR" ) local f24_local4, f24_local5 = nil local f24_local6 = function ( f25_arg0, f25_arg1 ) f25_arg0:setText( f25_arg1.creator ) end f24_local1[1] = f24_local2 f24_local1[2] = f24_local3 f24_local1[3] = f24_local4 f24_local1[4] = f24_local5 f24_local1[5] = f24_local6 f24_local2 = {} f24_local3 = "online_vault_detail_mode_id" f24_local4 = Engine.Localize( "@MPUI_VAULT_GAMETYPE" ) f24_local5, f24_local6 = nil local f24_local7 = function ( f26_arg0, f26_arg1 ) f26_arg0:setText( f26_arg1.baseMode ) end f24_local2[1] = f24_local3 f24_local2[2] = f24_local4 f24_local2[3] = f24_local5 f24_local2[4] = f24_local6 f24_local2[5] = f24_local7 f24_local3 = {} f24_local4 = "online_vault_detail_map_id" f24_local5 = Engine.Localize( "@MPUI_VAULT_MAP" ) f24_local6, f24_local7 = nil local f24_local8 = function ( f27_arg0, f27_arg1 ) f27_arg0:setText( f27_arg1.map ) end f24_local3[1] = f24_local4 f24_local3[2] = f24_local5 f24_local3[3] = f24_local6 f24_local3[4] = f24_local7 f24_local3[5] = f24_local8 f24_local4 = {} f24_local5 = "online_vault_detail_create_time_id" f24_local6 = Engine.Localize( "@MPUI_VAULT_DATETIME" ) f24_local7, f24_local8 = nil local f24_local9 = function ( f28_arg0, f28_arg1 ) f28_arg0:setText( f28_arg1.timestamp ) end f24_local4[1] = f24_local5 f24_local4[2] = f24_local6 f24_local4[3] = f24_local7 f24_local4[4] = f24_local8 f24_local4[5] = f24_local9 f24_local5 = {} f24_local6 = "online_vault_detail_desc_label_id" f24_local7 = Engine.Localize( "@MPUI_VAULT_DESCRIPTION" ) local f24_local8, f24_local9, f24_local10 = nil f24_local5[1] = f24_local6 f24_local5[2] = f24_local7 f24_local5[3] = f24_local8 f24_local5[4] = f24_local9 f24_local5[5] = f24_local10 f24_local6 = {} f24_local7 = "online_vault_detail_desc_value_id" f24_local8, f24_local9 = nil f24_local10 = function ( f29_arg0, f29_arg1 ) f29_arg0:setText( f29_arg1.desc ) end local f24_local11 = nil f24_local6[1] = f24_local7 f24_local6[2] = f24_local8 f24_local6[3] = f24_local9 f24_local6[4] = f24_local10 f24_local6[5] = f24_local11 f24_local0[1] = f24_local1 f24_local0[2] = f24_local2 f24_local0[3] = f24_local3 f24_local0[4] = f24_local4 f24_local0[5] = f24_local5 f24_local0[6] = f24_local6 f24_local1 = {} for f24_local5, f24_local6 in pairs( f24_local0 ) do f24_local1[f24_local5] = DetailTextFactory( f24_local6[1], f24_local6[2], f24_local6[3], f24_local6[4], f24_local6[5] ) end return f24_local1 end function ClipDetailsFeeder( f30_arg0 ) local f30_local0 = {} local f30_local1 = {} for f30_local5, f30_local6 in pairs( f30_local0 ) do f30_local1[f30_local5] = DetailTextFactory( f30_local6[1], f30_local6[2], f30_local6[3], f30_local6[4], f30_local6[5] ) end return f30_local1 end function FilmDetailsFeeder( f31_arg0 ) local f31_local0 = {} local f31_local1 = {} local f31_local2 = "online_vault_detail_creator_id" local f31_local3 = Engine.Localize( "@MPUI_VAULT_CREATOR" ) local f31_local4, f31_local5 = nil local f31_local6 = function ( f32_arg0, f32_arg1 ) f32_arg0:setText( f32_arg1.creator ) end f31_local1[1] = f31_local2 f31_local1[2] = f31_local3 f31_local1[3] = f31_local4 f31_local1[4] = f31_local5 f31_local1[5] = f31_local6 f31_local2 = {} f31_local3 = "online_vault_detail_mode_id" f31_local4 = Engine.Localize( "@MPUI_VAULT_GAMETYPE" ) f31_local5, f31_local6 = nil local f31_local7 = function ( f33_arg0, f33_arg1 ) f33_arg0:setText( f33_arg1.baseMode ) end f31_local2[1] = f31_local3 f31_local2[2] = f31_local4 f31_local2[3] = f31_local5 f31_local2[4] = f31_local6 f31_local2[5] = f31_local7 f31_local3 = {} f31_local4 = "online_vault_detail_map_id" f31_local5 = Engine.Localize( "@MPUI_VAULT_MAP" ) f31_local6, f31_local7 = nil local f31_local8 = function ( f34_arg0, f34_arg1 ) f34_arg0:setText( f34_arg1.map ) end f31_local3[1] = f31_local4 f31_local3[2] = f31_local5 f31_local3[3] = f31_local6 f31_local3[4] = f31_local7 f31_local3[5] = f31_local8 f31_local4 = {} f31_local5 = "online_vault_detail_duration_id" f31_local6 = Engine.Localize( "@MPUI_VAULT_DURATION" ) f31_local7, f31_local8 = nil local f31_local9 = function ( f35_arg0, f35_arg1 ) f35_arg0:setText( f35_arg1.duration ) end f31_local4[1] = f31_local5 f31_local4[2] = f31_local6 f31_local4[3] = f31_local7 f31_local4[4] = f31_local8 f31_local4[5] = f31_local9 f31_local5 = {} f31_local6 = "online_vault_detail_desc_label_id" f31_local7 = Engine.Localize( "@MPUI_VAULT_DESCRIPTION" ) local f31_local8, f31_local9, f31_local10 = nil f31_local5[1] = f31_local6 f31_local5[2] = f31_local7 f31_local5[3] = f31_local8 f31_local5[4] = f31_local9 f31_local5[5] = f31_local10 f31_local6 = {} f31_local7 = "online_vault_detail_desc_value_id" f31_local8, f31_local9 = nil f31_local10 = function ( f36_arg0, f36_arg1 ) f36_arg0:setText( f36_arg1.desc ) end local f31_local11 = nil f31_local6[1] = f31_local7 f31_local6[2] = f31_local8 f31_local6[3] = f31_local9 f31_local6[4] = f31_local10 f31_local6[5] = f31_local11 f31_local0[1] = f31_local1 f31_local0[2] = f31_local2 f31_local0[3] = f31_local3 f31_local0[4] = f31_local4 f31_local0[5] = f31_local5 f31_local0[6] = f31_local6 f31_local1 = {} for f31_local5, f31_local6 in pairs( f31_local0 ) do f31_local1[f31_local5] = DetailTextFactory( f31_local6[1], f31_local6[2], f31_local6[3], f31_local6[4], f31_local6[5] ) end return f31_local1 end function DetailsFeeder( f37_arg0 ) local f37_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "online_vault_main" ) local f37_local1 = f37_local0.itemType if f37_local1 == FileTypes.Film then return FilmDetailsFeeder( f37_arg0 ) elseif f37_local1 == FileTypes.Clip then return ClipDetailsFeeder( f37_arg0 ) elseif f37_local1 == FileTypes.Screenshot then return ScreenshotDetailsFeeder( f37_arg0 ) elseif f37_local1 == FileTypes.CustomGame then return GameModeDetailsFeeder( f37_arg0 ) else DebugPrint( "OnlineVault attempting to get details for unsupported type!" ) return {} end end function BrowseRenameOption( f38_arg0 ) return { type = "UIGenericButton", id = f38_arg0 or "browse_rename_option_id", disabled = true, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_ONLINEVAULT_RENAME" ), callback_params = MBh.Property( "callback_params" ), button_action_func = RenameVaultItem } } end function BrowseDeleteOption( f39_arg0 ) return { type = "UIGenericButton", id = f39_arg0 or "browse_delete_option_id", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_ONLINEVAULT_DELETE" ), callback_params = MBh.Property( "callback_params" ), button_action_func = DoDeleteConfirm } } end function BrowseScreenshotFeeder( f40_arg0 ) local f40_local0 = {} local f40_local1 = { type = "UIGenericButton", id = "browse_screenshot_view_id", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_ONLINEVAULT_VIEW" ), callback_params = MBh.Property( "callback_params" ), button_action_func = ViewScreenshot } } local f40_local2 = { type = "UIGenericButton", id = "browse_screenshot_share", disabled = true, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_ONLINEVAULT_FACEBOOK" ), callback_params = MBh.Property( "callback_params" ) } } local f40_local3 = BrowseRenameOption( "browse_screenshot_rename" ) local f40_local4 = BrowseDeleteOption( "browse_screenshot_delete_id" ) return f40_local1 end function BrowseGameModeFeeder( f41_arg0 ) local f41_local0 = {} local f41_local1 = BrowseRenameOption( "browse_mode_rename_id" ) local f41_local2 = BrowseDeleteOption( "browse_mode_delete_id" ) return f41_local1 end function BrowseFilmFeeder( f42_arg0 ) local f42_local0 = {} local f42_local1 = { type = "UIGenericButton", id = "browse_film_play_id", disabled = true, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@MENU_ONLINEVAULT_PLAY" ), callback_params = MBh.Property( "callback_params" ) } } local f42_local2 = BrowseRenameOption( "browse_film_rename" ) local f42_local3 = BrowseDeleteOption( "browse_film_delete_id" ) return f42_local1 end function online_vault_fetching_popup() return { type = "generic_confirmation_popup", id = "online_vault_fetching_popup_id", properties = { popup_title = Engine.Localize( "@MENU_PLEASE_WAIT" ), message_text = Engine.Localize( "@MENU_ONLINEVAULT_FETCHING" ), button_text = Engine.Localize( "@MENU_CANCEL" ), confirmation_action = CancelFetch }, handlers = { live_storage_private_data_update = MBh.LeaveMenu() } } end function online_vault_please_wait_popup() return { type = "generic_popup_message", id = "online_vault_please_wait_popup_id", properties = { message_text = Engine.Localize( "@MENU_PLEASE_WAIT" ) } } end function online_vault_load_mode_success_popup() return { type = "generic_confirmation_popup", id = "online_vault_load_mode_success_popup_id", properties = { popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CAPS" ), message_text = Engine.Localize( "@MENU_CGM_LOAD_SUCCESS" ), button_text = Engine.Localize( "@MENU_OK" ), confirmation_action = MBh.EmitEventToRoot( { name = "leave_vault", restoreMenu = "gamesetup_menu_main", dispatchChildren = true, immediate = true } ) } } end function online_vault_save_mode_result_popup() return { type = "generic_confirmation_popup", id = "online_vault_save_mode_result_popup_id", properties = { popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CAPS" ), button_text = Engine.Localize( "@MENU_OK" ), confirmation_action = MBh.EmitEventToRoot( { name = "leave_vault", dispatchChildren = true, immediate = true } ) } } end function online_vault_load_mode_fail_popup() return { type = "generic_confirmation_popup", id = "online_vault_load_mode_fail_popup_id", properties = { popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CAPS" ), message_text = Engine.Localize( "@MENU_CGM_LOAD_FAILED" ), button_text = Engine.Localize( "@MENU_OK" ) } } end function online_vault_confirm_overwrite_popup() return { type = "generic_yesno_popup", id = "online_vault_confirm_overwrite_popup_id", properties = { popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CONFIRM_OVERWRITE" ), callback_params = { saveToSlot = -1 }, yes_action = SaveVaultItem } } end function online_vault_browse_cgm_popup() return { type = "generic_selectionList_popup", id = "online_vault_browse_cgm_popup_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ), popup_childfeeder = BrowseGameModeFeeder } } end function online_vault_browse_screenshot_popup() return { type = "generic_selectionList_popup", id = "online_vault_browse_screenshot_popup_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ), popup_childfeeder = BrowseScreenshotFeeder, callback_params = { slotIndex = -1 } } } end function online_vault_browse_film_popup() return { type = "generic_selectionList_popup", id = "online_vault_browse_film_popup_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ), popup_childfeeder = BrowseFilmFeeder, callback_params = { slotIndex = -1 } } } end function online_vault_browse_clip_popup() return { type = "generic_selectionList_popup", id = "online_vault_browse_clip_popup_id", properties = { popup_title = Engine.Localize( "@LUA_MENU_OPTIONS_CAPS" ), popup_childfeeder = BrowseClipFeeder, callback_params = { slotIndex = -1 } } } end function online_vault_confirm_delete_popup() return { type = "generic_yesno_popup", id = "online_vault_confirm_delete_popup_id", properties = { popup_title = Engine.Localize( "@MENU_WARNING" ), message_text = Engine.Localize( "@MENU_ONLINEVAULT_CONFIRM_DELETE" ), callback_params = { deleteSlot = -1 }, yes_action = OnConfirmDelete } } end function online_vault_delete_success_popup() return { type = "generic_confirmation_popup", id = "online_vault_delete_success_popup_id", properties = { popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CAPS" ), message_text = Engine.Localize( "@MENU_VAULT_DEL_SUCCESS" ), button_text = Engine.Localize( "@MENU_OK" ) } } end function online_vault_delete_fail_popup() return { type = "generic_confirmation_popup", id = "online_vault_delete_fail_popup_id", properties = { popup_title = Engine.Localize( "@MENU_ONLINEVAULT_CAPS" ), message_text = Engine.Localize( "@MENU_VAULT_DEL_FAILED" ), button_text = Engine.Localize( "@MENU_OK" ) } } end function online_vault_entry_widget() return { type = "UIButton", focusable = true, properties = { slot_index = 0, index_text = "", button_text = "", button_height = GenericButtonDims.button_height + 15, type_image = RegisterMaterial( "menu_mp_lobby_icon_film" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = MBh.Property( "button_height" ) } }, children = { { type = "UIGenericButton", properties = { button_text = MBh.Property( "button_text" ) } }, { type = "UIImage", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = false, rightAnchor = true, top = 10, bottom = -10, left = -50, right = -25, material = MBh.Property( "type_image" ), alpha = 1 }, disabled = { alpha = 0 } }, handlers = { button_disable = MBh.AnimateToState( "disabled", 0 ) } }, { type = "UIText", id = "entry_index_text_id", properties = { text = MBh.Property( "index_text" ) }, states = { default = { left = 0, top = 0, width = 20, height = CoD.TextSettings.NormalFont.Height, font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Left } } } } } end function online_vault_details_text() return { type = "UIElement", properties = { label_text = "", value_text = "", label_update_func = function ( f58_arg0, f58_arg1 ) end , value_update_func = function ( f59_arg0, f59_arg1 ) end }, states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = true, top = 0, bottom = GenericButtonDims.button_height, left = 0, right = 0 } }, children = { { type = "UIText", id = "online_vault_detail_label_id", properties = { text = MBh.Property( "label_text" ), label_update_func = MBh.Property( "label_update_func" ) }, states = { default = { leftAnchor = true, rightAnchor = false, topAnchor = true, bottomAnchor = false, left = 0, right = 480, top = 0, bottom = CoD.TextSettings.NormalFont.Height, font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Left } }, handlers = { update_details = MBh.Property( "label_update_func" ) } }, { type = "UIText", id = "online_vault_detail_value_id", properties = { text = MBh.Property( "value_text" ), value_update_func = MBh.Property( "value_update_func" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = CoD.TextSettings.SmallFont.Height, font = CoD.TextSettings.SmallFont.Font, alignment = LUI.Alignment.Right } }, handlers = { update_details = MBh.Property( "value_update_func" ) } } } } end function online_vault_details_widget() return { type = "UIElement", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 120, bottom = 600, left = 560, right = 1040 } }, children = { { type = "generic_menu_titlebar", id = "online_vault_details_title", properties = { font = CoD.TextSettings.BoldFont, title_bar_text = "Item Details", title_bar_text_indent = GenericTitleBarDims.TitleBarLCapWidth, title_bar_alignment = LUI.Alignment.Left }, handlers = { update_details = function ( f61_arg0, f61_arg1 ) f61_arg0:processEvent( { name = "update_title", dispatchChildren = true, title_text = f61_arg1.title } ) end } }, { type = "generic_menu_background", id = "online_vault_details_window_bg", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = GenericTitleBarDims.TitleBarHeight } } }, { type = "UIImage", id = "online_vault_details_image", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = true, material = RegisterMaterial( "" ), left = 10, right = -10, top = GenericTitleBarDims.TitleBarHeight + 10, height = 240 } }, handlers = { update_details = function ( f62_arg0, f62_arg1 ) f62_arg0:setImage( RegisterMaterial( f62_arg1.image ) ) end } }, { type = "UIVerticalList", id = "online_vault_details_vlist", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = GenericTitleBarDims.TitleBarHeight + 250 + 4, bottom = 600, left = 4, right = -4, spacing = 2 } }, handlers = { refresh_details = DoRefresh }, childrenFeeder = DetailsFeeder } } } end function online_vault_main() return { type = "UIElement", id = "online_vault_root", properties = { menu_title = Engine.Localize( "@MPUI_ONLINE_VAULT" ) }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0 } }, handlers = { menu_create = OnCreate, select_item = OnActionButton, update_selection = UpdateSelection, vault_notification = HandleVaultNotification, leave_vault = LeaveVault, open_screenshot_viewer = OpenScreenshotViewer }, children = { { type = "generic_menu_title", id = "online_vault_title_id", properties = { menu_title = MBh.Property( "menu_title" ) } }, { type = "UIVerticalList", id = "vault_entry_vlist_id", focusable = true, states = { default = { alignment = LUI.Alignment.Top, leftAnchor = true, rightAnchor = false, topAnchor = true, bottomAnchor = false, left = GenericMenuDims.menu_left, right = GenericMenuDims.menu_right, top = GenericMenuDims.menu_top, bottom = GenericMenuDims.menu_bottom } }, handlers = { vault_refresh = DoRefresh, live_storage_private_data_update = DoRefresh }, childrenFeeder = VaultEntryFeeder }, { type = "online_vault_details_widget", id = "online_vault_details_widget_id" }, { type = "online_friends_widget", id = "online_vault_friends_widget_id" }, { type = "UIBindButton", id = "online_vault_bind_button_id", handlers = { button_secondary = LeaveVault } }, { type = "button_helper_text_main", id = "online_vault_helper_text_id" } } } end LUI.MenuBuilder.registerDef( "online_vault_main", online_vault_main ) LUI.MenuBuilder.registerDef( "online_vault_entry_widget", online_vault_entry_widget ) LUI.MenuBuilder.registerDef( "online_vault_fetching_popup", online_vault_fetching_popup ) LUI.MenuBuilder.registerDef( "online_vault_load_mode_success_popup", online_vault_load_mode_success_popup ) LUI.MenuBuilder.registerDef( "online_vault_load_mode_fail_popup", online_vault_load_mode_fail_popup ) LUI.MenuBuilder.registerDef( "online_vault_confirm_overwrite_popup", online_vault_confirm_overwrite_popup ) LUI.MenuBuilder.registerDef( "online_vault_details_widget", online_vault_details_widget ) LUI.MenuBuilder.registerDef( "online_vault_details_text", online_vault_details_text ) LUI.MenuBuilder.registerDef( "online_vault_browse_screenshot_popup", online_vault_browse_screenshot_popup ) LUI.MenuBuilder.registerDef( "online_vault_browse_cgm_popup", online_vault_browse_cgm_popup ) LUI.MenuBuilder.registerDef( "online_vault_browse_film_popup", online_vault_browse_film_popup ) LUI.MenuBuilder.registerDef( "online_vault_browse_clip_popup", online_vault_browse_clip_popup ) LUI.MenuBuilder.registerDef( "online_vault_confirm_delete_popup", online_vault_confirm_delete_popup ) LUI.MenuBuilder.registerDef( "online_vault_delete_success_popup", online_vault_delete_success_popup ) LUI.MenuBuilder.registerDef( "online_vault_delete_fail_popup", online_vault_delete_fail_popup ) LUI.MenuBuilder.registerDef( "online_vault_please_wait_popup", online_vault_please_wait_popup ) LUI.MenuBuilder.registerDef( "online_vault_save_mode_result_popup", online_vault_save_mode_result_popup ) LockTable( _M )