local f0_local0 = module local f0_local1, f0_local2 = ... f0_local0( f0_local1, package.seeall ) CoD.PrintModuleLoad( _NAME ) function StartChallenge( f1_arg0, f1_arg1 ) local f1_local0, f1_local1 = f1_arg1( f1_arg0 ) if f1_local0 ~= -1 and f1_local1 ~= -1 and Playlist.DoAction( f1_local0, f1_local1, false, false ) then Squad.StartMatch( f1_arg0, false ) Engine.SetDvarBool( "squad_find_match", true ) LUI.FlowManager.RequestAddMenu( nil, "menu_xboxlive_lobby", false, f1_arg0, false, {} ) end end function ChallengeFriend( f2_arg0 ) StartChallenge( f2_arg0, Squad.FightFriend ) end function ChallengeRecentPlayer( f3_arg0 ) StartChallenge( f3_arg0, Squad.FightRecentPlayer ) end function ChallengeLivePartyPlayer( f4_arg0 ) StartChallenge( f4_arg0, Squad.FightLivePartyPlayer ) end function popup_elite_clan_updating() return { type = "live_dialog_text_box", id = "popup_elite_clan_updating_id", properties = { message = Engine.Localize( "@MENU_FACEBOOK_UPLOADING" ) } } end function popup_update_clan_finished() local f6_local0 if Engine.MarkLocalized( Engine.GetDvarString( "elite_clan_single_task_popup_text" ) ) == Engine.Localize( "MENU_CLAN_CREATED" ) then f6_local0 = Engine.Localize( "PATCH_MENU_CONGRATULATIONS" ) if not f6_local0 then else return { type = "generic_confirmation_popup", id = "popup_update_clan_finished", properties = { popup_title = f6_local0, message_text = Engine.GetDvarString( "elite_clan_single_task_popup_text" ), confirmation_action = function ( f7_arg0, f7_arg1 ) LUI.FlowManager.RequestLeaveMenu( f7_arg0, true ) end }, handlers = { menu_close = function ( f8_arg0, f8_arg1 ) f8_arg0:dispatchEventToRoot( { name = "close_actions", immediate = true } ) f8_arg0:dispatchEventToRoot( { name = "friends_refresh", forceRefresh = true } ) end } } end end f6_local0 = Engine.Localize( "@MENU_NOTICE" ) end function popup_friend_invite_sent() return { type = "generic_confirmation_popup", properties = { popup_title = Engine.Localize( "@MENU_POPUP_INVITE_SENT" ), message_text = Engine.Localize( "@MENU_POPUP_INVITE_SENT" ), dialog_top = -100, dialog_bottom = 100 } } end function popup_confirm_report() return { type = "generic_confirmation_popup", id = "popup_confirm_report", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = "", dialog_top = -100, dialog_bottom = 100 } } end function ReportPopupFeeder( f11_arg0 ) local f11_local0 = { { text = "@MENU_REPORT_OFFENSIVE", confirmationString = "@MENU_REPORT_OFFENSIVE_SUBMIT", offense = Friends.Constants.reportOffensiveLobbyPlayer }, { text = "@MENU_REPORT_EXPLOITING", confirmationString = "@MENU_REPORT_EXPLOITING_SUBMIT", offense = Friends.Constants.reportExploitingLobbyPlayer }, { text = "@MENU_REPORT_CHEATING", confirmationString = "@MENU_REPORT_CHEATING_SUBMIT", offense = Friends.Constants.reportCheatingLobbyPlayer }, { text = "@MENU_REPORT_BOOSTING", confirmationString = "@MENU_REPORT_BOOSTING_SUBMIT", offense = Friends.Constants.reportBoostingLobbyPlayer } } local f11_local1 = {} for f11_local5, f11_local6 in ipairs( f11_local0 ) do f11_local1[#f11_local1 + 1] = { type = "UIGenericButton", id = "offense_" .. f11_local5, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( f11_local6.text ), button_action_func = function ( f12_arg0, f12_arg1 ) LUI.FlowManager.RequestLeaveMenu( f12_arg0 ) f11_arg0.reportFunction( f12_arg1.controller, f11_local6.offense ) f11_arg0.confirmationAction( f12_arg0, f12_arg1, Engine.Localize( f11_local6.confirmationString ) ) end } } end return f11_local1 end function popup_friend_report() return { type = "generic_selectionList_popup", id = "popup_friend_report", properties = { popup_title = Engine.Localize( "@MENU_REPORT_PLAYER" ), popup_childfeeder = ReportPopupFeeder, friendIndex = 0, confirmationAction = function ( f14_arg0, f14_arg1, f14_arg2 ) LUI.FlowManager.RequestPopupMenu( f14_arg0, "popup_confirm_report", true, controller, false, { message_text = f14_arg2 } ) end , additional_handlers = { kill_friends_list = MBh.LeaveMenu() } }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 0, bottom = 0 } } } end function popup_kick_are_you_sure() return { type = "generic_yesno_popup", id = "popup_kick_are_you_sure", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@LUA_MENU_CLAN_KICK_ARE_YOU_SURE" ), yes_text = Engine.Localize( "@LUA_MENU_YES" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ), yes_action = function ( f16_arg0, f16_arg1 ) Clan.KickMemberFromClan( f16_arg1.controller ) end , additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function ChangeStatusFeeder() local f17_local0 = { [#f17_local0 + 1] = { type = "UIGenericButton", id = "member_status_coleader", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@CLANS_STATUS_COLEADER" ), button_action_func = function ( f18_arg0, f18_arg1 ) Clan.SetToCoLeader( f18_arg1.controller ) end, button_over_func = function ( f19_arg0, f19_arg1 ) f19_arg0:dispatchEventToRoot( { name = "update_member_status_desc", text = Engine.Localize( "@CLANS_STATUS_COLEADER_DESC" ) } ) end } }, [#f17_local0 + 1] = { type = "UIGenericButton", id = "member_status_member", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, text = Engine.Localize( "@CLANS_STATUS_MEMBER" ), button_action_func = function ( f20_arg0, f20_arg1 ) Clan.SetToClanMember( f20_arg1.controller ) end, button_over_func = function ( f21_arg0, f21_arg1 ) f21_arg0:dispatchEventToRoot( { name = "update_member_status_desc", text = Engine.Localize( "@CLANS_STATUS_MEMBER_DESC" ) } ) end } }, [#f17_local0 + 1] = { type = "UIElement", id = "spacer", states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = false, left = 0, right = 0, top = 0, bottom = 10 } } }, [#f17_local0 + 1] = { type = "UIText", id = "help_text", properties = { text = Engine.Localize( "@CLANS_STATUS_COLEADER_DESC" ) }, 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 } }, handlers = { update_member_status_desc = function ( f22_arg0, f22_arg1 ) f22_arg0:setText( f22_arg1.text or "" ) end } } } return f17_local0 end function popup_change_status() return { type = "generic_selectionList_popup", id = "popup_change_status_id", properties = { popup_title = Engine.Localize( "@CLANS_CHANGE_MEMBER_STATUS" ), popup_childfeeder = ChangeStatusFeeder, additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function popup_transfer_are_you_sure() return { type = "generic_yesno_popup", id = "popup_transfer_are_you_sure_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@CLANS_TRANSFER_LEADERSHIP_CONFIRM" ), yes_text = Engine.Localize( "@LUA_MENU_YES" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ), yes_action = function ( f25_arg0, f25_arg1 ) Clan.TransferLeadership( f25_arg1.controller ) end , additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function popup_leave_are_you_sure() return { type = "generic_yesno_popup", id = "popup_leave_are_you_sure_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@CLANS_LEAVE_CONFIRM" ), yes_text = Engine.Localize( "@LUA_MENU_YES" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ), yes_action = function ( f27_arg0, f27_arg1 ) Clan.LeaveClan( f27_arg1.controller ) if LUI.FlowManager.IsMenuInStack( f27_arg0:getRootParent(), "menu_barracks" ) then LUI.FlowManager.RequestRestoreMenu( f27_arg0, "menu_barracks", true, f27_arg1.controller ) end end , additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function popup_leave_leader_are_you_sure() return { type = "generic_yesno_popup", id = "popup_leave_leader_are_you_sure_id", properties = { popup_title = Engine.Localize( "@MENU_WARNING" ), message_text = Engine.Localize( "@CLANS_LEADER_LEAVE_CONFIRM" ), yes_text = Engine.Localize( "@LUA_MENU_YES" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ), yes_action = function ( f29_arg0, f29_arg1 ) Clan.LeaveClan( f29_arg1.controller ) if LUI.FlowManager.IsMenuInStack( f29_arg0:getRootParent(), "menu_barracks" ) then LUI.FlowManager.RequestRestoreMenu( f29_arg0, "menu_barracks", true, f29_arg1.controller ) end end , additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function popup_leave_leader_with_members() return { type = "generic_confirmation_popup", id = "popup_leave_leader_with_members_id", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@CLANS_LEADER_CANT_LEAVE" ), button_text = Engine.Localize( "@MENU_OK" ), additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function GetFriendRequestLocString() return Engine.Localize( Engine.IsXB3() and "LUA_MENU_FRIEND_FOLLOW" or "MENU_FRIEND_REQUEST" ) end function LivePartyFriendActionsFeeder( f32_arg0, f32_arg1 ) local f32_local0 = {} local f32_local1 = Engine.IsXbox360() if not f32_local1 then f32_local1 = Engine.IsXB3() if not f32_local1 then f32_local1 = Engine.IsPS4() end end local f32_local2 = not Engine.InFrontend() local f32_local3 = Engine.InLobby() if Engine.IsMultiplayer() then local f32_local4 = #f32_local0 + 1 local f32_local5 = { type = "UIGenericButton", id = "invite" } local f32_local6 = Friends.IsLivePartyLocal( f32_arg1.controller ) if not f32_local6 then if Engine.GetDvarBool( "onlinegame" ) then f32_local6 = isAliensSolo() else f32_local6 = true end end f32_local5.disabled = f32_local6 f32_local6 = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup } local f32_local7 if f32_local2 or f32_local3 then f32_local7 = Engine.Localize( "@MENU_INVITE_TO_GAME" ) if not f32_local7 then else f32_local6.button_text = f32_local7 f32_local6.button_action_func = function ( f33_arg0, f33_arg1 ) LUI.FlowManager.RequestLeaveMenu( f33_arg0 ) Friends.InviteLivePartyFriend( f33_arg1.controller ) end f32_local5.properties = f32_local6 f32_local0[f32_local4] = f32_local5 end end f32_local7 = Engine.Localize( "@MENU_INVITE_TO_PARTY" ) end local f32_local4 = #f32_local0 + 1 local f32_local5 = { type = "UIGenericButton", id = "join" } local f32_local6 = Friends.IsLivePartyLocal( f32_arg1.controller ) if not f32_local6 then f32_local6 = not Engine.UserCanPlayOnline( f32_arg1.controller ) end f32_local5.disabled = f32_local6 f32_local5.properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_JOIN_GAME" ), button_action_func = function ( f34_arg0, f34_arg1 ) LUI.FlowManager.RequestLeaveMenu( f34_arg0 ) Friends.JoinLivePartyFriend( f34_arg1.controller ) end } f32_local0[f32_local4] = f32_local5 if Clan.IsEnabled() and Clan.CanISendInviteToLiveParty( f32_arg1.controller, f32_arg0.friendIndex ) and f32_local2 == false then f32_local0[#f32_local0 + 1] = { type = "UIGenericButton", id = "clan_invite", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@LUA_MENU_CLAN_INVITE_TO_CLAN" ), button_action_func = function ( f35_arg0, f35_arg1 ) if Engine.IsChatRestricted() then LUI.FlowManager.RequestPopupMenu( f35_arg0, "user_generated_content_restriction_popup", true, f35_arg1.controller ) else Clan.InviteLivePartyToClan( f35_arg1.controller ) end end } } end if f32_local1 then f32_local0[#f32_local0 + 1] = { type = "UIGenericButton", id = "profile", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@XBOXLIVE_VIEW_PROFILE" ), button_action_func = function ( f36_arg0, f36_arg1 ) Friends.ShowLivePartyFriendGamercard( f36_arg1.controller ) end } } end f32_local0[#f32_local0 + 1] = { type = "UIGenericButton", id = "report", disabled = Friends.IsLivePartyFriendMe( f32_arg1.controller, f32_arg0.friendIndex ), properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_REPORT_PLAYER" ), button_action_func = function ( f37_arg0, f37_arg1 ) LUI.FlowManager.RequestLeaveMenu( f37_arg0 ) LUI.FlowManager.RequestPopupMenu( f37_arg0, "popup_friend_report", true, f37_arg1.controller, false, { friendIndex = f32_arg0.friendIndex, reportFunction = Friends.ReportLivePartyFriend } ) end } } return f32_local0 end function OnlineFriendActionsFeeder( f38_arg0, f38_arg1 ) local f38_local0 = {} local f38_local1 = Engine.IsXbox360() if not f38_local1 then f38_local1 = Engine.IsXB3() if not f38_local1 then f38_local1 = Engine.IsPS4() end end local f38_local2 = not Engine.InFrontend() local f38_local3 = Engine.InLobby() local f38_local4 = function () local f39_local0 if IsOnlineMatch() and Friends.IsFriendInvitable( f38_arg1.controller ) then f39_local0 = isAliensSolo() else f39_local0 = true end return f39_local0 end if Engine.IsMultiplayer() then local f38_local5 = #f38_local0 + 1 local f38_local6 = { type = "UIGenericButton", id = "invite", disabledFunc = f38_local4 } local f38_local7 = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup } local f38_local8 if f38_local2 or f38_local3 then f38_local8 = Engine.Localize( "@MENU_INVITE_TO_GAME" ) if not f38_local8 then else f38_local7.button_text = f38_local8 f38_local7.button_action_func = function ( f40_arg0, f40_arg1 ) LUI.FlowManager.RequestLeaveMenu( f40_arg0 ) Friends.InviteOnlineFriend( f40_arg1.controller ) end f38_local6.properties = f38_local7 f38_local6.handlers = { element_refresh = function ( f41_arg0, f41_arg1 ) if f38_local4() then f41_arg0:processEvent( { name = "disable" } ) else f41_arg0:processEvent( { name = "enable" } ) end end } f38_local0[f38_local5] = f38_local6 end end f38_local8 = Engine.Localize( "@MENU_INVITE_TO_PARTY" ) end if Engine.IsMultiplayer() or not Engine.IsPS4() and not Engine.IsXB3() and Engine.IsConsoleGame() then local f38_local5 = function () local f42_local0 if Engine.UserCanPlayOnline( f38_arg1.controller ) then f42_local0 = not Friends.IsFriendJoinable( f38_arg1.controller ) else f42_local0 = true end return f42_local0 end f38_local0[#f38_local0 + 1] = { type = "UIGenericButton", id = "join", disabledFunc = f38_local5, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_JOIN_GAME" ), button_action_func = function ( f43_arg0, f43_arg1 ) LUI.FlowManager.RequestLeaveMenu( f43_arg0 ) Friends.JoinOnlineFriend( f43_arg1.controller ) end }, handlers = { element_refresh = function ( f44_arg0, f44_arg1 ) if f38_local5() then f44_arg0:processEvent( { name = "disable" } ) else f44_arg0:processEvent( { name = "enable" } ) end end } } end if Clan.IsEnabled() and Clan.CanISendInviteToFriend( f38_arg1.controller, f38_arg0.friendIndex ) and f38_local2 == false then f38_local0[#f38_local0 + 1] = { type = "UIGenericButton", id = "clan_invite", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@LUA_MENU_CLAN_INVITE_TO_CLAN" ), button_action_func = function ( f45_arg0, f45_arg1 ) if Engine.IsChatRestricted() then LUI.FlowManager.RequestPopupMenu( f45_arg0, "user_generated_content_restriction_popup", true, f45_arg1.controller ) else Clan.InviteFriendToClan( f45_arg1.controller ) end end } } end local f38_local5 = function () return not Friends.CanShowFriendGamercard( f38_arg1.controller ) end if f38_local1 then f38_local0[#f38_local0 + 1] = { type = "UIGenericButton", id = "profile", disabledFunc = f38_local5, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@XBOXLIVE_VIEW_PROFILE" ), button_action_func = function ( f47_arg0, f47_arg1 ) Friends.ShowOnlineFriendGamercard( f47_arg1.controller ) end }, handlers = { element_refresh = function ( f48_arg0, f48_arg1 ) if f38_local5() then f48_arg0:processEvent( { name = "disable" } ) else f48_arg0:processEvent( { name = "enable" } ) end end } } end f38_local0[#f38_local0 + 1] = { type = "UIGenericButton", id = "report", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_REPORT_PLAYER" ), button_action_func = function ( f49_arg0, f49_arg1 ) LUI.FlowManager.RequestLeaveMenu( f49_arg0 ) LUI.FlowManager.RequestPopupMenu( f49_arg0, "popup_friend_report", true, f49_arg1.controller, false, { friendIndex = f38_arg0.friendIndex, reportFunction = Friends.ReportOnlineFriend } ) end } } return f38_local0 end function popup_join_on_blocked_player_are_you_sure() return { type = "generic_yesno_popup", id = "popup_join_on_blocked_player_are_you_sure", properties = { popup_title = Engine.Localize( "@MENU_NOTICE" ), message_text = Engine.Localize( "@XBOXLIVE_JOIN_ON_BLOCKED_USER_CONFIRM" ), yes_text = Engine.Localize( "@LUA_MENU_YES" ), no_text = Engine.Localize( "@LUA_MENU_CANCEL" ), yes_action = function ( f51_arg0, f51_arg1 ) Friends.JoinRecentPlayer( f51_arg1.controller ) end , additional_handlers = { kill_friends_list = MBh.LeaveMenu() } } } end function RecentPlayerActionsFeeder( f52_arg0, f52_arg1 ) local f52_local0 = {} local f52_local1 = Engine.IsXbox360() if not f52_local1 then f52_local1 = Engine.IsXB3() if not f52_local1 then f52_local1 = Engine.IsPS4() end end local f52_local2 = not Engine.InFrontend() local f52_local3 = Engine.InLobby() if Engine.IsConsoleGame() then if Engine.IsMultiplayer() then local f52_local4 = #f52_local0 + 1 local f52_local5 = { type = "UIGenericButton", id = "invite" } local f52_local6 if Engine.GetDvarBool( "onlinegame" ) then f52_local6 = isAliensSolo() else f52_local6 = true end f52_local5.disabled = f52_local6 f52_local6 = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup } local f52_local7 if f52_local2 or f52_local3 then f52_local7 = Engine.Localize( "@MENU_INVITE_TO_GAME" ) if not f52_local7 then else f52_local6.button_text = f52_local7 f52_local6.button_action_func = function ( f53_arg0, f53_arg1 ) LUI.FlowManager.RequestLeaveMenu( f53_arg0 ) Friends.InviteRecentPlayer( f53_arg1.controller ) end f52_local5.properties = f52_local6 f52_local0[f52_local4] = f52_local5 end end f52_local7 = Engine.Localize( "@MENU_INVITE_TO_PARTY" ) end f52_local0[#f52_local0 + 1] = { type = "UIGenericButton", id = "join", disabled = not Engine.UserCanPlayOnline( f52_arg1.controller ), properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_JOIN_GAME" ), button_action_func = function ( f54_arg0, f54_arg1 ) if Engine.IsXB3() and Friends.IsUserInBlockList( f54_arg1.controller ) then LUI.FlowManager.RequestPopupMenu( f54_arg0, "popup_join_on_blocked_player_are_you_sure", true, f54_arg1.controller, false, { friendIndex = f52_arg0.friendIndex } ) else LUI.FlowManager.RequestLeaveMenu( f54_arg0 ) Friends.JoinRecentPlayer( f54_arg1.controller ) end end } } end if Clan.IsEnabled() and Clan.CanISendInviteToRecentPlayer( f52_arg1.controller, f52_arg0.friendIndex ) and f52_local2 == false then f52_local0[#f52_local0 + 1] = { type = "UIGenericButton", id = "clan_invite", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@LUA_MENU_CLAN_INVITE_TO_CLAN" ), button_action_func = function ( f55_arg0, f55_arg1 ) if Engine.IsChatRestricted() then LUI.FlowManager.RequestPopupMenu( f55_arg0, "user_generated_content_restriction_popup", true, f55_arg1.controller ) else Clan.InviteRecentPlayerToClan( f55_arg1.controller ) end end } } end if f52_local1 then f52_local0[#f52_local0 + 1] = { type = "UIGenericButton", id = "profile", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@XBOXLIVE_VIEW_PROFILE" ), button_action_func = function ( f56_arg0, f56_arg1 ) Friends.ShowRecentPlayerGamercard( f56_arg1.controller ) end } } end if not Engine.IsPS4() then f52_local0[#f52_local0 + 1] = { type = "UIGenericButton", id = "add_friend_btn", disabled = Friends.IsRecentPlayerAFriend( f52_arg1.controller ), properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = GetFriendRequestLocString(), button_action_func = function ( f57_arg0, f57_arg1 ) Friends.RequestRecentPlayerAsFriend( f57_arg1.controller ) end } } end f52_local0[#f52_local0 + 1] = { type = "UIGenericButton", id = "report", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_REPORT_PLAYER" ), button_action_func = function ( f58_arg0, f58_arg1 ) LUI.FlowManager.RequestLeaveMenu( f58_arg0 ) LUI.FlowManager.RequestPopupMenu( f58_arg0, "popup_friend_report", true, f58_arg1.controller, false, { friendIndex = f52_arg0.friendIndex, reportFunction = Friends.ReportRecentPlayer } ) end } } return f52_local0 end function EliteClanFriendActionsFeeder( f59_arg0, f59_arg1 ) local f59_local0 = {} local f59_local1 = Engine.IsXbox360() if not f59_local1 then f59_local1 = Engine.IsXB3() if not f59_local1 then f59_local1 = Engine.IsPS4() end end local f59_local2 = not Engine.InFrontend() local f59_local3 = Engine.InLobby() local f59_local4 = Friends.IsEliteClanFriendMe( f59_arg1.controller, f59_arg0.friendIndex ) if Engine.IsMultiplayer() then local f59_local5 = #f59_local0 + 1 local f59_local6 = { type = "UIGenericButton", id = "invite" } local f59_local7 = f59_local4 local f59_local8 if Engine.GetDvarBool( "onlinegame" ) then f59_local8 = isAliensSolo() else f59_local8 = f59_local7 or true end f59_local6.disabled = f59_local8 f59_local8 = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup } local f59_local9 if f59_local2 or f59_local3 then f59_local9 = Engine.Localize( "@MENU_INVITE_TO_GAME" ) if not f59_local9 then else f59_local8.button_text = f59_local9 f59_local8.button_action_func = function ( f60_arg0, f60_arg1 ) LUI.FlowManager.RequestLeaveMenu( f60_arg0 ) Friends.InviteEliteClanFriend( f60_arg1.controller ) end f59_local6.properties = f59_local8 f59_local0[f59_local5] = f59_local6 end end f59_local9 = Engine.Localize( "@MENU_INVITE_TO_PARTY" ) end f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "join", disabled = f59_local4 or not Engine.UserCanPlayOnline( f59_arg1.controller ), properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_JOIN_GAME" ), button_action_func = function ( f61_arg0, f61_arg1 ) LUI.FlowManager.RequestLeaveMenu( f61_arg0 ) Friends.JoinEliteClanFriend( f61_arg1.controller ) end } } if f59_local2 == false then if Clan.CanIChangeMemberStatus( f59_arg1.controller ) and f59_local4 == false then f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "clan_change_status", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@CLANS_CHANGE_MEMBER_STATUS" ), button_action_func = function ( f62_arg0, f62_arg1 ) LUI.FlowManager.RequestPopupMenu( f62_arg0, "popup_change_status", true, f62_arg1.controller, false, { friendIndex = f59_arg0.friendIndex } ) end } } end if Clan.CanIKickMember( f59_arg1.controller ) and f59_local4 == false then f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "clan_kick", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@LUA_MENU_CLAN_KICK_FROM_CLAN" ), button_action_func = function ( f63_arg0, f63_arg1 ) LUI.FlowManager.RequestPopupMenu( f63_arg0, "popup_kick_are_you_sure", true, f63_arg1.controller, false, { friendIndex = f59_arg0.friendIndex } ) end } } end if Clan.AmILeader( f59_arg1.controller ) and f59_local4 == false then f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "clan_transfer_ownership", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@CLANS_TRANSFER_OWNERSHIP" ), button_action_func = function ( f64_arg0, f64_arg1 ) LUI.FlowManager.RequestPopupMenu( f64_arg0, "popup_transfer_are_you_sure", true, f64_arg1.controller, false, { friendIndex = f59_arg0.friendIndex } ) end } } end if f59_local4 then f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "clan_leave", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@CLANS_LEAVE_CLAN" ), button_action_func = function ( f65_arg0, f65_arg1 ) local f65_local0 = "popup_leave_are_you_sure" if Clan.AmILeader( f59_arg1.controller ) then if Clan.GetMemberCount( f59_arg1.controller ) > 1 then local f65_local1 = "popup_leave_leader_with_members" end f65_local0 = f65_local1 or "popup_leave_leader_are_you_sure" end LUI.FlowManager.RequestPopupMenu( f65_arg0, f65_local0, true, f65_arg1.controller, false ) end } } end end if f59_local1 then f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "profile", properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@XBOXLIVE_VIEW_PROFILE" ), button_action_func = function ( f66_arg0, f66_arg1 ) Friends.ShowEliteClanFriendGamercard( f66_arg1.controller ) end } } end if not Engine.IsPS4() then f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "add_friend_btn", disabled = f59_local4 or Friends.IsEliteClanPlayerAFriend( f59_arg1.controller ), properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = GetFriendRequestLocString(), button_action_func = function ( f67_arg0, f67_arg1 ) Friends.RequestEliteClanPlayerAsFriend( f67_arg1.controller ) end } } end f59_local0[#f59_local0 + 1] = { type = "UIGenericButton", id = "report", disabled = f59_local4, properties = { style = GenericButtonSettings.Styles.GlassButton, substyle = GenericButtonSettings.Styles.GlassButton.SubStyles.Popup, button_text = Engine.Localize( "@MENU_REPORT_PLAYER" ), button_action_func = function ( f68_arg0, f68_arg1 ) LUI.FlowManager.RequestPopupMenu( f68_arg0, "popup_friend_report", true, f68_arg1.controller, false, { friendIndex = f59_arg0.friendIndex, reportFunction = Friends.ReportEliteClanFriend } ) end } } return f59_local0 end function ActionsFeeder( f69_arg0 ) local f69_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "popup_friends" ) if f69_local0.actionsFeeder then return f69_local0.actionsFeeder( f69_arg0, f69_local0 ) else return {} end end function popup_friend_list_actions() return { type = "generic_selectionList_popup", id = "popup_friend_list_actions", handlers = { close_actions = MBh.LeaveMenu() }, properties = { popup_title = "", popup_childfeeder = ActionsFeeder, friendIndex = 0, additional_handlers = { kill_friends_list = MBh.LeaveMenu() } }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 0, bottom = 0 } }, children = { { type = "UITimer", id = "friends_actions_refresh_timer", properties = { event = { name = "element_refresh" }, interval = 1000 } } } } end function RefreshScrollbar( f71_arg0 ) if f71_arg0.scrollbar then f71_arg0.scrollbar:manualUpdate( f71_arg0.slot_offset, f71_arg0.maxButtonsOnPage, f71_arg0.total, Friends.Constants.FriendButtonHeight ) end end function ScrollBy( f72_arg0, f72_arg1, f72_arg2, f72_arg3 ) local f72_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f72_arg0 ) local f72_local1 = f72_local0.slot_offset f72_local0.slot_offset = LUI.clamp( f72_local0.slot_offset + f72_arg3, 0, math.max( 0, f72_local0.total - f72_local0.maxButtonsOnPage ) ) if f72_local1 ~= f72_local0.slot_offset then local f72_local2 = f72_arg0:getParent() if f72_arg1.qualifier ~= ButtonQualifiers.Mousewheel then f72_arg0:processEvent( { name = "lose_focus", immediate = true } ) end f72_local2:dispatchEventToRoot( { name = "friends_refresh", immediate = true } ) if f72_arg1.qualifier ~= ButtonQualifiers.Mousewheel then local f72_local3 = f72_local2:getChildById( "friend_button_" .. f72_arg2 ) f72_local3:processEvent( { name = "gain_focus", immediate = true } ) end end RefreshScrollbar( f72_local0 ) end function FriendButtonGamepadButton( f73_arg0, f73_arg1, f73_arg2 ) local f73_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f73_arg0 ) if f73_arg1.down and f73_arg0:isInFocus() then if f73_arg1.qualifier == ButtonQualifiers.Mousewheel then if f73_arg1.button == "up" then ScrollBy( f73_arg0, f73_arg1, f73_arg2, -1 ) elseif f73_arg1.button == "down" then ScrollBy( f73_arg0, f73_arg1, f73_arg2, 1 ) end return true elseif f73_arg1.button == "up" and f73_arg2 == 0 then ScrollBy( f73_arg0, f73_arg1, f73_arg2, -1 ) return true elseif f73_arg1.button == "down" and f73_arg2 == f73_local0.maxButtonsOnPage - 1 then ScrollBy( f73_arg0, f73_arg1, f73_arg2, 1 ) return true end end return LUI.UIButton.GamepadButton( f73_arg0, f73_arg1 ) end function FriendButtonOverAction( f74_arg0, f74_arg1, f74_arg2 ) local f74_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f74_arg0 ) if f74_arg0.properties.toTopAllowed then f74_arg0:dispatchEventToRoot( { name = "update_to_top_button_helper", immediate = true } ) end local f74_local1 = f74_local0.current_slot f74_local0.current_slot = f74_arg0.properties.buttonNumber if f74_local0.controller and f74_arg0.properties.friendIndex then f74_arg2( f74_local0.controller, f74_arg0.properties.friendIndex ) end if Engine.IsConsoleGame() or f74_arg1.focusType ~= FocusType.MouseOver then local f74_local2 if f74_local0.current_slot > f74_local0.upScrollBoundary or f74_local0.current_slot >= f74_local1 then f74_local2 = false else f74_local2 = true end local f74_local3 if f74_local0.downScrollBoundary > f74_local0.current_slot or f74_local1 >= f74_local0.current_slot then f74_local3 = false else f74_local3 = true end local f74_local4 = f74_local2 and f74_local0.slot_offset > 0 local f74_local5 = f74_local3 and f74_local0.slot_offset < f74_local0.total - f74_local0.maxButtonsOnPage if f74_local4 then ScrollBy( f74_arg0, f74_arg1, f74_local1, -1 ) elseif f74_local5 then ScrollBy( f74_arg0, f74_arg1, f74_local1, 1 ) else f74_arg0:dispatchEventToRoot( { name = "friends_refresh", immediate = true } ) end else f74_arg0:dispatchEventToRoot( { name = "friends_refresh", immediate = true } ) end end function OpenFriendsOptionPopup( f75_arg0, f75_arg1, f75_arg2, f75_arg3 ) local f75_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f75_arg0 ) LUI.FlowManager.RequestPopupMenu( f75_arg0, "popup_friend_list_actions", true, f75_arg3, false, { popup_title = f75_arg1, friendIndex = f75_arg2 } ) end function OpenChallengePopup( f76_arg0, f76_arg1, f76_arg2 ) if not Engine.InFrontend() or not f76_arg0.properties.challengeFunc then return else f76_arg0:dispatchEventToRoot( { name = "kill_friends_list", immediate = true } ) LUI.FlowManager.RequestLeaveMenu( f76_arg0 ) f76_arg0.properties.challengeFunc( f76_arg2 ) end end function friend_button_children( f77_arg0, f77_arg1, f77_arg2, f77_arg3, f77_arg4, f77_arg5, f77_arg6, f77_arg7, f77_arg8, f77_arg9 ) local f77_local0 = {} local f77_local1 = LUI.FlowManager.GetMenuScopedDataByMenuName( "popup_friends" ) if Engine.InFrontend() then f77_local0[#f77_local0 + 1] = { type = "UIImage", states = { default = CoD.ColorizeState( Colors.black, { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = false, top = 0, bottom = -1, left = 0, width = 100, alpha = 0 } ), visible = { alpha = 1 } }, children = { { type = "UIImage", states = { default = CoD.ColorizeState( Colors.black, { topAnchor = true, bottomAnchor = true, leftAnchor = false, rightAnchor = true, top = 30, bottom = 0, left = 0, width = 342 } ) } } }, handlers = { button_over = MBh.AnimateToState( "visible" ), button_up = MBh.AnimateToState( "default" ) } } f77_local0[#f77_local0 + 1] = { type = "playercard", properties = { force_show_rank = true, patchScale = -0.15 }, states = { default = { alpha = 0 }, visible = { alpha = 1 } }, handlers = { button_over = MBh.AnimateToState( "visible" ), button_up = MBh.AnimateToState( "default" ) } } f77_local0[#f77_local0 + 1] = { type = "UIImage", id = "small_rectangle_id", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 20, height = 16, left = 450, width = 5, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b, material = RegisterMaterial( "white" ) }, over = { red = 0, green = 0, blue = 0 } }, handlers = { button_over = MBh.AnimateToState( "over" ), button_up = MBh.AnimateToState( "default" ) } } f77_local0[#f77_local0 + 1] = { type = "UIText", id = "friend_button_subtext", states = { default = CoD.ColorizeState( Colors.primary_text_color, { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = true, left = 469, right = -15, top = 60, height = CoD.TextSettings.NormalFont.Height, font = CoD.TextSettings.NormalFont.Font, alignment = LUI.Alignment.Right } ), over = { red = Colors.black.r, green = Colors.black.g, blue = Colors.black.b } }, handlers = { button_over = MBh.AnimateToState( "over" ), button_up = MBh.AnimateToState( "default" ), subtext_refresh = function ( f78_arg0, f78_arg1 ) f78_arg0:setText( f78_arg1.text or "" ) end } } else local f77_local2 = Engine.IsAliensMode() and CoD.PlayMode.Aliens or CoD.PlayMode.Core f77_local0[#f77_local0 + 1] = { type = "UIImage", id = "rank_background_id", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 0, height = 49, left = 0, width = 60, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b, alpha = 0.2, material = RegisterMaterial( "white" ) }, over = { red = 0, green = 0, blue = 0, alpha = 1 } }, handlers = { button_over = MBh.AnimateToState( "over" ), button_up = MBh.AnimateToState( "default" ) } } f77_local0[#f77_local0 + 1] = { type = "UIImage", id = "rank_emblem_id", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 14, height = 21, left = 3, width = 25, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b }, over = { red = 1, green = 1, blue = 1 } }, handlers = { button_over = MBh.AnimateToState( "over" ), button_up = MBh.AnimateToState( "default" ), rank_refresh = function ( f79_arg0, f79_arg1 ) f79_arg0:setImage( RegisterMaterial( Rank.GetRankIcon( f79_arg1.rank, f79_arg1.prestige, f77_local2 ) ) ) end } } f77_local0[#f77_local0 + 1] = { type = "UIText", id = "rank_number_id", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 14, height = 21, left = 31, width = 22, red = Colors.primary_text_color.r, green = Colors.primary_text_color.g, blue = Colors.primary_text_color.b, font = CoD.TextSettings.BigFont.Font, alignment = LUI.Alignment.Center }, over = { red = Colors.white.r, green = Colors.white.g, blue = Colors.white.b } }, handlers = { button_over = MBh.AnimateToState( "over" ), button_up = MBh.AnimateToState( "default" ), rank_refresh = function ( f80_arg0, f80_arg1 ) f80_arg0:setText( Rank.GetRankDisplay( f80_arg1.rank, f77_local2 ) ) end } } f77_local0[#f77_local0 + 1] = { type = "UIImage", id = "small_rectangle_id", states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 14, height = 21, left = 470, width = 5, red = Colors.secondary_text_color.r, green = Colors.secondary_text_color.g, blue = Colors.secondary_text_color.b, material = RegisterMaterial( "white" ) }, over = { red = 0, green = 0, blue = 0 } }, handlers = { button_over = MBh.AnimateToState( "over" ), button_up = MBh.AnimateToState( "default" ) } } end return f77_local0 end function friend_button( f81_arg0, f81_arg1, f81_arg2, f81_arg3, f81_arg4, f81_arg5, f81_arg6, f81_arg7, f81_arg8, f81_arg9, f81_arg10, f81_arg11, f81_arg12, f81_arg13 ) return { type = "UIGenericButton", id = "friend_button_" .. f81_arg1, properties = { style = GenericButtonSettings.Styles.FlatButton, substyle = GenericButtonSettings.Styles.FlatButton.SubStyles.SubMenu, variant = GenericButtonSettings.Variants.Info, buttonNumber = f81_arg1, toTopAllowed = f81_arg12, button_display_func = function ( f82_arg0, f82_arg1 ) if f81_arg0.slot_offset and f81_arg1 then return f81_arg9( f81_arg0.controller, f81_arg0.slot_offset + f81_arg1 ) else end end , height = Engine.InFrontend() and Friends.Constants.FriendButtonHeight or 49, y_offset = Engine.InFrontend() and -17 or 0, content_width = Engine.InFrontend() and 260 or 450, content_margin = Engine.InFrontend() and 40 or 10, text_padding_with_content = Engine.InFrontend() and 116 or 70, label_align = LUI.Alignment.Left, text_align_with_content = LUI.Alignment.Left, text_default_color = { r = 1, g = 1, b = 1, a = 1 }, text_focus_color = Engine.InFrontend() and { a = 0 } or Colors.black, content_focus_color_without_bg = Colors.black, use_locking = false, challengeFunc = f81_arg13 }, handlers = { gamepad_button = function ( f83_arg0, f83_arg1 ) return FriendButtonGamepadButton( f83_arg0, f83_arg1, f81_arg1 ) end , button_over = function ( f84_arg0, f84_arg1 ) FriendButtonOverAction( f84_arg0, f84_arg1, f81_arg11 ) end , button_action = function ( f85_arg0, f85_arg1 ) local f85_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f85_arg0 ) if not f85_local0.challengeMode then OpenFriendsOptionPopup( f85_arg0, f85_arg0.properties.friendName, f85_local0.slot_offset + f81_arg1, f85_arg1.controller ) else OpenChallengePopup( f85_arg0, f85_arg0.properties.friendIndex, f85_arg1.controller ) end end , element_refresh = function ( f86_arg0, f86_arg1 ) local f86_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f86_arg0 ) local f86_local1 = f86_local0.slot_offset + f81_arg1 f86_arg0.properties.friendIndex = f86_local1 if f86_arg0:isInFocus() then f81_arg11( f86_local0.controller, f86_local1 ) end local f86_local2 = { gamertag = f81_arg2( f86_local0.controller, f86_local1 ) } if not Engine.IsChatRestricted() then f86_local2.clantag = f81_arg3( f86_local0.controller, f86_local1 ) end f86_local2.rank = f81_arg7( f86_local0.controller, f86_local1 ) f86_local2.prestige = f81_arg8( f86_local0.controller, f86_local1 ) f86_local2.background = f81_arg6 and f81_arg6( f86_local0.controller, f86_local1 ) or 0 f86_local2.patchEmblem = f81_arg4 and f81_arg4( f86_local0.controller, f86_local1 ) or 0 f86_local2.patchShape = f81_arg5 and f81_arg5( f86_local0.controller, f86_local1 ) or 0 f86_local2.name = "update_playercard" f86_arg0:processEvent( f86_local2 ) f86_arg0.properties.friendName = f86_local2.gamertag if not Engine.InFrontend() and f86_local2.clantag and f86_local2.clantag ~= "" then f86_arg0:setText( "[" .. f86_local2.clantag .. "]" .. f86_local2.gamertag ) else f86_arg0:setText( f86_local2.gamertag ) end f86_arg0:processEvent( { name = "content_refresh" } ) f86_arg0:processEvent( { name = "subtext_refresh", text = f81_arg10( f86_local0.controller, f86_local1 ) } ) if not Engine.InFrontend() then f86_arg0:processEvent( { name = "rank_refresh", rank = f86_local2.rank, prestige = f86_local2.prestige } ) end end }, children = friend_button_children( f81_arg1, f81_arg2, f81_arg3, f81_arg4, f81_arg5, f81_arg6, f81_arg7, f81_arg8, f81_arg9, f81_arg10 ) } end function no_friends( f87_arg0 ) return { type = "UIElement", id = "no_friends_id", properties = { text = f87_arg0 }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, top = 0, bottom = 0, left = 0, right = Friends.Constants.scrollbarWidth } }, children = { { type = "UIElement", id = "container", properties = { text = MBh.Property( "text" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 70, bottom = -167 } }, children = { { type = "UIText", id = "no_friends_txt", properties = { text = MBh.Property( "text" ), textStyle = CoD.TextStyle.Shadowed }, states = { default = CoD.ColorizeState( Colors.primary_text_color, { leftAnchor = true, rightAnchor = true, topAnchor = false, bottomAnchor = false, left = 0, right = 0, height = CoD.TextSettings.BigFont.Height, font = CoD.TextSettings.BigFont.Font, alignment = LUI.Alignment.Center } ) } } } } } } end function EmptySubTextGetter( f88_arg0, f88_arg1 ) return "" end function FriendFeederFactory( f89_arg0, f89_arg1, f89_arg2, f89_arg3, f89_arg4, f89_arg5, f89_arg6, f89_arg7, f89_arg8, f89_arg9, f89_arg10, f89_arg11, f89_arg12 ) return function ( f90_arg0, f90_arg1 ) local f90_local0 = {} if f90_arg1.total > 0 then for f90_local1 = 0, math.min( f90_arg1.maxButtonsOnPage - 1, f90_arg1.total - 1 ), 1 do f90_local0[#f90_local0 + 1] = friend_button( f90_arg1, f90_local1, f89_arg0, f89_arg3, f89_arg4, f89_arg5, f89_arg6, f89_arg7, f89_arg8, f89_arg1, f89_arg2, f89_arg9, f89_arg11, f89_arg12 ) end else f90_local0[#f90_local0 + 1] = f89_arg10() end return f90_local0 end end function OnlineFriendsFeeder( f91_arg0, f91_arg1 ) local f91_local0 = Engine.IsAliensMode() local f91_local1 = FriendFeederFactory local f91_local2 = Friends.GetOnlineFriendGamertag local f91_local3 = Friends.GetOnlineFriendPresence local f91_local4 = EmptySubTextGetter local f91_local5 = Friends.GetOnlineFriendClanTag local f91_local6 = Friends.GetOnlineFriendPatch local f91_local7 = Friends.GetOnlineFriendPatchbacking local f91_local8 = Friends.GetOnlineFriendBackground local f91_local9 if f91_local0 then f91_local9 = Friends.GetOnlineFriendAlienRank if not f91_local9 then else local f91_local10 if f91_local0 then f91_local10 = Friends.GetOnlineFriendAlienPrestige if not f91_local10 then else f91_local1 = f91_local1( f91_local2, f91_local3, f91_local4, f91_local5, f91_local6, f91_local7, f91_local8, f91_local9, f91_local10, Friends.SetOnlineFriendStoredXUID, function () return no_friends( Engine.Localize( "@PLATFORM_NO_FRIENDS" ) ) end, true, ChallengeFriend ) return f91_local1( f91_arg0, f91_arg1 ) end end f91_local10 = Friends.GetOnlineFriendPrestige end end f91_local9 = Friends.GetOnlineFriendRank end function LivePartyFriendsFeeder( f93_arg0, f93_arg1 ) local f93_local0 = Engine.IsAliensMode() local f93_local1 = FriendFeederFactory local f93_local2 = Friends.GetLivePartyFriendGamertag local f93_local3 = Friends.GetLivePartyFriendPresence local f93_local4 = EmptySubTextGetter local f93_local5 = Friends.GetLivePartyFriendClanTag local f93_local6 = Friends.GetLivePartyFriendPatch local f93_local7 = Friends.GetLivePartyFriendPatchbacking local f93_local8 = Friends.GetLivePartyFriendBackground local f93_local9 if f93_local0 then f93_local9 = Friends.GetLivePartyFriendAlienRank if not f93_local9 then else local f93_local10 if f93_local0 then f93_local10 = Friends.GetLivePartyFriendAlienPrestige if not f93_local10 then else f93_local1 = f93_local1( f93_local2, f93_local3, f93_local4, f93_local5, f93_local6, f93_local7, f93_local8, f93_local9, f93_local10, Friends.SetLivePartyFriendStoredXUID, function () return no_friends( Engine.Localize( "@PLATFORM_NOT_IN_PARTY" ) ) end, false, ChallengeLivePartyPlayer ) return f93_local1( f93_arg0, f93_arg1 ) end end f93_local10 = Friends.GetLivePartyFriendPrestige end end f93_local9 = Friends.GetLivePartyFriendRank end function RecentPlayersFeeder( f95_arg0, f95_arg1 ) local f95_local0 = Engine.IsAliensMode() local f95_local1 = FriendFeederFactory local f95_local2 = Friends.GetRecentPlayerGamertag local f95_local3 = Friends.GetRecentPlayerPresence local f95_local4 = EmptySubTextGetter local f95_local5 = Friends.GetRecentPlayerClanTag local f95_local6 = Friends.GetRecentPlayerPatch local f95_local7 = Friends.GetRecentPlayerPatchbacking local f95_local8 = Friends.GetRecentPlayerBackground local f95_local9 if f95_local0 then f95_local9 = Friends.GetRecentPlayerAlienRank if not f95_local9 then else local f95_local10 if f95_local0 then f95_local10 = Friends.GetRecentPlayerAlienPrestige if not f95_local10 then else f95_local1 = f95_local1( f95_local2, f95_local3, f95_local4, f95_local5, f95_local6, f95_local7, f95_local8, f95_local9, f95_local10, Friends.SetRecentPlayerStoredXUID, function () return no_friends( Engine.Localize( "@LUA_MENU_NO_RECENT_PLAYERS" ) ) end, false, ChallengeRecentPlayer ) return f95_local1( f95_arg0, f95_arg1 ) end end f95_local10 = Friends.GetRecentPlayerPrestige end end f95_local9 = Friends.GetRecentPlayerRank end function EliteClanFriendsFeeder( f97_arg0, f97_arg1 ) local f97_local0 = Engine.IsAliensMode() local f97_local1 = FriendFeederFactory local f97_local2 = Friends.GetEliteClanFriendGamertag local f97_local3 = Friends.GetEliteClanFriendPresence local f97_local4 = Friends.GetEliteClanFriendMemberStatus local f97_local5 = Friends.GetEliteClanFriendClanTag local f97_local6 = Friends.GetEliteClanFriendPatch local f97_local7 = Friends.GetEliteClanFriendPatchbacking local f97_local8 = Friends.GetEliteClanFriendBackground local f97_local9 if f97_local0 then f97_local9 = Friends.GetEliteClanFriendAlienRank if not f97_local9 then else local f97_local10 if f97_local0 then f97_local10 = Friends.GetEliteClanFriendAlienPrestige if not f97_local10 then else f97_local1 = f97_local1( f97_local2, f97_local3, f97_local4, f97_local5, f97_local6, f97_local7, f97_local8, f97_local9, f97_local10, Friends.SetEliteClanFriendStoredXUID, function () if not CoDAnywhere.ServiceAvailable( f97_arg1.controller ) then return no_friends( Engine.Localize( "@LUA_MENU_COD_ANYWHERE_ERROR_SERVICE" ) ) elseif Clan.IsDownloadingData( f97_arg1.controller ) then return { type = "generic_loading_widget", properties = { message = Engine.Localize( "@MENU_DOWNLOADING" ) } } else return no_friends( Engine.Localize( "@MENU_NO_CLAN_DESCRIPTION" ) ) end end, false, false ) return f97_local1( f97_arg0, f97_arg1 ) end end f97_local10 = Friends.GetEliteClanFriendPrestige end end f97_local9 = Friends.GetEliteClanFriendRank end function DebugFriendsFeeder( f99_arg0, f99_arg1 ) local f99_local0 = FriendFeederFactory( function ( f100_arg0, f100_arg1 ) return "Friend " .. f100_arg1 end, function () return "At the beach" end, function () return "h" end, function () return "OINK" end, function () return 0 end, function () return 0 end, function () return 0 end, function () return 10 end, function () return 1 end, function () end, function () return no_friends( "No debug friends" ) end, false ) return f99_local0( f99_arg0, f99_arg1 ) end function WIPFeeder( f111_arg0, f111_arg1 ) local f111_local0 = {} return no_friends( "Work in Progress" ) end function MainFriendFeeder( f112_arg0 ) local f112_local0 = LUI.FlowManager.GetMenuScopedDataByMenuName( "popup_friends" ) if f112_local0.feeder then return f112_local0.feeder( f112_arg0, f112_local0 ) else return {} end end function CursorToTop( f113_arg0, f113_arg1 ) local f113_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f113_arg0 ) if f113_local0.slot_offset == 0 and f113_local0.current_slot == 0 then return else f113_local0.slot_offset = 0 f113_local0.current_slot = 0 RefreshPage( f113_arg0, f113_arg1 ) f113_arg0:dispatchEventToChildren( { name = "focus_vlist", immediate = true } ) end end function PlatformShouldShowGameInvites() local f114_local0 = Engine.IsPS3() if not f114_local0 then f114_local0 = Engine.IsPS4() end return f114_local0 end function PlatformShouldShowPartyGameInvites() return Engine.IsXB3() end function PlatformShouldShowPartyUI() return Engine.IsXbox360() end function UpdateToTopButtonHelper( f117_arg0 ) local f117_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f117_arg0 ) local f117_local1 if f117_local0.slot_offset <= 0 and f117_local0.current_slot <= 0 then f117_local1 = false else f117_local1 = true end local f117_local2 = f117_arg0 local f117_local3 = f117_arg0.processEvent local f117_local4 = { name = "add_button_helper_text", button_ref = "button_alt1" } local f117_local5 if f117_local1 then f117_local5 = Engine.Localize( "@LUA_MENU_TOP" ) if not f117_local5 then else f117_local4.helper_text = f117_local5 f117_local4.side = "left" f117_local4.clickable = true f117_local3( f117_local2, f117_local4 ) end end f117_local5 = "" end function UpdateSelectButtonHelper( f118_arg0 ) local f118_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f118_arg0 ) if f118_local0.total then local f118_local1 = f118_local0.total > 0 end local f118_local2 = "" if not f118_local0.challengeMode then f118_local2 = Engine.Localize( "@LUA_MENU_SELECT" ) else f118_local2 = Engine.Localize( "@LUA_MENU_CHALLENGE" ) end f118_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_action", helper_text = f118_local2, side = "left", clickable = true } ) end function SetOnlineFriendsHelpers( f119_arg0 ) local f119_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f119_arg0 ) UpdateToTopButtonHelper( f119_arg0 ) if PlatformShouldShowGameInvites() and Friends.CountPendingPlaystationInvites and Friends.CountPendingPlaystationInvites( f119_local0.controller ) > 0 then f119_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = Engine.Localize( "@PLATFORM_VIEW_GAME_INVITES" ), side = "left", clickable = true } ) else f119_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = "", side = "left", clickable = true } ) end f119_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_start", helper_text = "", side = "left", clickable = true } ) end function SetRecentPlayersHelpers( f120_arg0 ) SetOnlineFriendsHelpers( f120_arg0 ) f120_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = "", side = "left", clickable = true } ) end function SetLivePartyHelpers( f121_arg0 ) local f121_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f121_arg0 ) local f121_local1 = f121_local0.total if f121_local1 then f121_local1 = f121_local0.total > 1 end local f121_local2 = Engine.GetDvarBool( "onlinegame" ) local f121_local3 = Engine.Localize local f121_local4 if f121_local1 and f121_local2 then f121_local4 = "@PLATFORM_INVITE_XBOX_LIVE_PARTY" if not f121_local4 then else f121_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt1", helper_text = f121_local3( f121_local4 ), side = "left", clickable = true } ) if PlatformShouldShowPartyUI() then f121_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = Engine.Localize( "@PLATFORM_PARTY_UI" ), side = "left", clickable = true } ) else f121_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = "", side = "left", clickable = true } ) end if PlatformShouldShowPartyGameInvites() and Friends.HasPartyGameInvite() then f121_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_start", helper_text = Engine.Localize( "@XBOXLIVE_PARTY_INVITE_ACCEPT" ), side = "left", clickable = false } ) else f121_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_start", helper_text = "", side = "left", clickable = true } ) end end end f121_local4 = "@MENU_INVITE_FRIENDS" end function SetClanFriendsHelpers( f122_arg0 ) local f122_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f122_arg0 ) UpdateToTopButtonHelper( f122_arg0 ) f122_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_alt2", helper_text = "", side = "left", clickable = true } ) f122_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_start", helper_text = "", side = "left", clickable = true } ) end function ButtonAlt1Action( f123_arg0, f123_arg1 ) local f123_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f123_arg0 ) if f123_local0.CurrentAlt1Action and f123_arg1.controller == f123_local0.exclusiveController then f123_local0.CurrentAlt1Action( f123_arg0, f123_arg1 ) end end function ButtonAlt2Action( f124_arg0, f124_arg1 ) local f124_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f124_arg0 ) if f124_local0.CurrentAlt2Action and f124_arg1.controller == f124_local0.exclusiveController then f124_local0.CurrentAlt2Action( f124_arg0, f124_arg1 ) end end function ButtonStartAction( f125_arg0, f125_arg1 ) local f125_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f125_arg0 ) if f125_local0.CurrentStartAction and f125_arg1.controller == f125_local0.exclusiveController then f125_local0.CurrentStartAction( f125_arg0, f125_arg1 ) end end function ChangePage( f126_arg0, f126_arg1, f126_arg2, f126_arg3 ) local f126_local0 if f126_arg2 == 0 then f126_local0 = not f126_arg3 else f126_local0 = false end local f126_local1 = LUI.FlowManager.GetMenuScopedDataFromElement( f126_arg0 ) local f126_local2 = {} if not f126_local1.isClanRoster then f126_local2[#f126_local2 + 1] = { title = Engine.Localize( "@LUA_MENU_FRIENDS" ), feeder = OnlineFriendsFeeder, actionsFeeder = OnlineFriendActionsFeeder, friendsCounter = Friends.GetOnlineFriendsCount, helpers = SetOnlineFriendsHelpers, alt1Action = function ( f127_arg0, f127_arg1 ) f127_arg0:dispatchEventToRoot( { name = "cursor_to_top_trigger", immediate = true } ) end, alt2Action = function ( f128_arg0, f128_arg1 ) if PlatformShouldShowGameInvites() and Friends.CountPendingPlaystationInvites and Friends.CountPendingPlaystationInvites( f128_arg1.controller ) > 0 then Engine.Exec( "gameInvitesReceived", f128_arg1.controller ) end end } end if not f126_local1.isClanRoster then f126_local2[#f126_local2 + 1] = { title = Engine.Localize( "@MENU_RECENT_PLAYERS" ), feeder = RecentPlayersFeeder, actionsFeeder = RecentPlayerActionsFeeder, friendsCounter = Friends.GetRecentPlayersCount, helpers = SetRecentPlayersHelpers, alt1Action = function ( f129_arg0, f129_arg1 ) f129_arg0:dispatchEventToRoot( { name = "cursor_to_top_trigger", immediate = true } ) end } end if not f126_local1.isClanRoster and (Engine.IsXbox360() or Engine.IsXB3()) and not f126_local1.challengeMode then f126_local2[#f126_local2 + 1] = { title = Engine.Localize( "@XBOXLIVE_LIVE_PARTY" ), actionsFeeder = LivePartyFriendActionsFeeder, feeder = LivePartyFriendsFeeder, friendsCounter = Friends.GetLivePartyFriendsCount, helpers = SetLivePartyHelpers, alt1Action = function ( f130_arg0, f130_arg1 ) local f130_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f130_arg0 ) local f130_local1 = f130_local0.total if f130_local1 then f130_local1 = f130_local0.total > 1 end if Engine.GetDvarBool( "onlinegame" ) and f130_local1 then Friends.InviteAllLiveParty( f130_arg1.controller ) elseif Friends.OpenSystemFriendsList then Friends.OpenSystemFriendsList( f130_arg1.controller ) else Engine.Exec( "xshowfriendslist" ) end end, alt2Action = function ( f131_arg0, f131_arg1 ) Friends.OpenLivePartyUI( f131_arg1.controller ) end, startAction = function ( f132_arg0, f132_arg1 ) if Friends.HasPartyGameInvite() then Friends.AcceptLivePartyInvitation( f132_arg1.controller ) end end } end local f126_local3 = nil if Clan.IsEnabled() and not f126_local1.challengeMode then f126_local2[#f126_local2 + 1] = { title = Friends.GetEliteClanName( f126_local1.controller ), feeder = EliteClanFriendsFeeder, actionsFeeder = EliteClanFriendActionsFeeder, friendsCounter = Friends.GetEliteClanFriendsCount, helpers = SetClanFriendsHelpers, alt1Action = function ( f133_arg0, f133_arg1 ) f133_arg0:dispatchEventToRoot( { name = "cursor_to_top_trigger", immediate = true } ) end } f126_local3 = #f126_local2 end if not f126_local1.total then f126_local1.total = 0 end local f126_local4 = f126_local1.page_index local f126_local5 = f126_local4 f126_local4 = math.max( 1, math.min( f126_local4 + f126_arg2, #f126_local2 ) ) if f126_arg2 ~= 0 and f126_local4 == f126_local5 then return end f126_local1.page_index = f126_local4 f126_local1.feeder = f126_local2[f126_local4].feeder f126_local1.actionsFeeder = f126_local2[f126_local4].actionsFeeder local f126_local6 = f126_local1.total f126_local1.total = f126_local2[f126_local4].friendsCounter( f126_local1.controller ) if f126_arg2 ~= 0 and f126_local1.total == 0 then Engine.PlaySound( CoD.SFX.MouseOver ) end if f126_local0 then f126_local0 = f126_local1.total == f126_local6 end if not f126_local0 and not f126_local1.isTopOfStack then f126_local1.total = f126_local6 return end local f126_local7 = Clan.IsDownloadingData( f126_local1.controller ) if f126_local0 then if f126_local1.page_index == f126_local3 and f126_local1.wasDownloadingClanData then f126_local0 = f126_local7 else f126_local0 = true end end f126_local1.wasDownloadingClanData = f126_local7 if not f126_local0 then f126_local1.current_slot = 0 f126_local1.slot_offset = 0 f126_arg0:processEvent( { name = "wipe_vlist" } ) f126_local1.maxButtonsOnPage = Engine.InFrontend() and 5 or 9 f126_local1.upScrollBoundary = 1 f126_local1.downScrollBoundary = f126_local1.maxButtonsOnPage - 2 end if not f126_local0 then f126_arg0:processEvent( { name = "menu_refresh" } ) else f126_arg0:processEvent( { name = "element_refresh" } ) end if not f126_local0 then if f126_local1.isTopOfStack and not f126_arg1.mouse then f126_arg0:processEvent( { name = "focus_vlist" } ) end if f126_local1.isClanRoster then f126_arg0:processEvent( { name = "hide_arrows" } ) else if f126_local4 == 1 then f126_arg0:processEvent( { name = "disable_left_arrow" } ) else f126_arg0:processEvent( { name = "enable_left_arrow" } ) end if f126_local4 == #f126_local2 then f126_arg0:processEvent( { name = "disable_right_arrow" } ) else f126_arg0:processEvent( { name = "enable_right_arrow" } ) end end f126_arg0:processEvent( { name = "update_title", title_text = f126_local2[f126_local4].title } ) f126_local1.CurrentAlt1Action = f126_local2[f126_local4].alt1Action f126_local1.CurrentAlt2Action = f126_local2[f126_local4].alt2Action f126_local1.CurrentStartAction = f126_local2[f126_local4].startAction UpdateSelectButtonHelper( f126_arg0 ) end if f126_local1.total and 0 < f126_local1.total then f126_arg0:processEvent( { name = "show_scrollbar" } ) if f126_local1.scrollbar then f126_local1.scrollbar:manualUpdate( f126_local1.slot_offset, f126_local1.maxButtonsOnPage, f126_local1.total, Friends.Constants.FriendButtonHeight ) end else f126_arg0:processEvent( { name = "hide_scrollbar" } ) end if f126_local2[f126_local4].helpers then f126_local2[f126_local4].helpers( f126_arg0 ) end end function NextPage( f134_arg0, f134_arg1 ) local f134_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f134_arg0 ) if f134_arg1.controller == f134_local0.exclusiveController then ChangePage( f134_arg0, f134_arg1, 1, true ) end end function PreviousPage( f135_arg0, f135_arg1 ) local f135_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f135_arg0 ) if f135_arg1.controller == f135_local0.exclusiveController then ChangePage( f135_arg0, f135_arg1, -1, true ) end end function RefreshPage( f136_arg0, f136_arg1 ) ChangePage( f136_arg0, f136_arg1, 0, f136_arg1.forceRefresh or false ) end function UpdatePopupTitle( f137_arg0, f137_arg1 ) f137_arg0:setText( f137_arg1.title ) end f0_local0 = function ( f138_arg0, f138_arg1 ) local f138_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f138_arg0 ) f138_local0.isTopOfStack = true f138_local0.controller = f138_arg0.properties.exclusiveController f138_local0.isClanRoster = f138_arg0.properties.isClanRoster f138_local0.feeder = function () return {} end f138_local0.page_index = 1 f138_local0.slot_offset = 0 f138_local0.current_slot = 0 f138_local0.scrollbar = f138_arg0:getFirstDescendentById( "scrollbar" ) f138_local0.scrollbar:setList( f138_arg0:getFirstDescendentById( "friends_vlist" ) ) if Friends.IsEliteClanAllowed( f138_local0.controller ) and Engine.InFrontend() and 0 > Engine.GetDvarInt( "elite_clan_delay" ) then Engine.Exec( "starteliteclan" ) end if Engine.IsXB3() then Engine.ExecNow( "friends_refresh", f138_local0.controller ) end Engine.ExecNow( "refreshfacebookfriends" ) Engine.ExecNow( "eliteclan_refresh", f138_arg0.properties.exclusiveController ) f138_arg0:processEvent( { name = "add_button_helper_text", button_ref = "button_secondary", helper_text = Engine.Localize( "@LUA_MENU_BACK" ), side = "left", clickable = true } ) if Friends.HasPartyGameInvite() and not f138_local0.isClanRoster then ChangePage( f138_arg0, f138_arg1, 2, true ) else ChangePage( f138_arg0, f138_arg1, 0, true ) end end function friends_list() return { type = "UIElement", id = "friends_list_id", states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 0, bottom = 0 } }, handlers = { menu_create = f0_local0, popup_active = function ( f141_arg0, f141_arg1 ) local f141_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f141_arg0 ) f141_local0.isTopOfStack = false end , popup_inactive = function ( f142_arg0, f142_arg1 ) local f142_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f142_arg0 ) f142_local0.isTopOfStack = true end , previous_page = PreviousPage, next_page = NextPage, friends_refresh = RefreshPage, cursor_to_top_trigger = CursorToTop, update_to_top_button_helper = UpdateToTopButtonHelper, live_connection = function ( f143_arg0, f143_arg1 ) if f143_arg1.signed_in == nil then f143_arg1.signed_in = Engine.IsUserSignedInToLive() end if not f143_arg1.signed_in then f143_arg0:dispatchEventToRoot( { name = "kill_friends_list", immediate = true } ) LUI.FlowManager.RequestLeaveMenu( f143_arg0 ) end end }, children = { { type = "UITimer", id = "friends_refresh_timer", properties = { event = { name = "friends_refresh", dispatchChildren = true }, interval = 1000 } }, { type = "UIImage", states = { default = CoD.ColorizeState( Swatches.Overlay.Color, { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = 0, bottom = 0, material = RegisterMaterial( "white" ), alpha = Swatches.Overlay.AlphaMore } ) } }, { type = "UIImage", id = "black_bar_1", states = { default = { leftAnchor = true, topAnchor = true, rightAnchor = true, bottomAnchor = false, left = 0, bottom = 0, right = 0, height = 300, red = 0, green = 0, blue = 0, alpha = Engine.InFrontend() and 0 or 1, material = RegisterMaterial( "white" ) } } }, { type = "UIImage", id = "black_bar_2", states = { default = { leftAnchor = true, topAnchor = false, rightAnchor = true, bottomAnchor = true, left = 0, top = 0, right = 0, height = 300, red = 0, green = 0, blue = 0, alpha = Engine.InFrontend() and 0 or 1, material = RegisterMaterial( "white" ) } } }, { type = "UIElement", id = "popup", properties = { exclusiveController = MBh.Property( "exclusiveController" ) }, states = { default = { topAnchor = false, bottomAnchor = false, leftAnchor = false, rightAnchor = false, top = -275, bottom = 275, left = Engine.InFrontend() and -395 or -485, right = Engine.InFrontend() and 395 or 485 } }, children = { { type = "generic_drop_shadow", properties = { offset_shadow = 0 } }, { type = "generic_menu_titlebar", id = "popup_title", properties = { title_bar_text = "", fill_alpha = 1 } }, { type = "UIWorldBlur", id = "optionsWorldBlurOverlay", states = { default = { worldBlur = Engine.InFrontend() and 0 or 5 } } }, { type = "generic_menu_background", id = "popup_background", properties = { fill_alpha = 1 } }, { 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 } } } }, { type = "UIButton", id = "arrow_left_btn", requireFocusType = FocusType.MouseOver, states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = true, rightAnchor = false, top = 6, bottom = 28, left = 50, right = 72, alpha = 1 }, disabled = { alpha = 0.3 }, hidden = { alpha = 0 } }, handlers = { button_action = function ( f144_arg0, f144_arg1 ) f144_arg0:dispatchEventToRoot( { name = "previous_page", mouse = true, controller = f144_arg1.controller } ) end , enable_left_arrow = MBh.AnimateToState( "default" ), disable_left_arrow = MBh.AnimateToState( "disabled" ), hide_arrows = MBh.AnimateToState( "hidden" ) }, children = { { type = "UIImage", id = "arrow_left", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 22, right = -22, material = RegisterMaterial( "widg_lobby_arrow" ) } } } } }, { type = "UIButton", id = "arrow_right_btn", requireFocusType = FocusType.MouseOver, states = { default = { topAnchor = true, bottomAnchor = false, leftAnchor = false, rightAnchor = true, top = 6, bottom = 28, left = -72, right = -50, alpha = 1 }, disabled = { alpha = 0.3 }, hidden = { alpha = 0 } }, handlers = { button_action = function ( f145_arg0, f145_arg1 ) f145_arg0:dispatchEventToRoot( { name = "next_page", mouse = true, controller = f145_arg1.controller } ) end , enable_right_arrow = MBh.AnimateToState( "default" ), disable_right_arrow = MBh.AnimateToState( "disabled" ), hide_arrows = MBh.AnimateToState( "hidden" ) }, children = { { type = "UIImage", id = "arrow_right", states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = true, rightAnchor = true, top = 0, bottom = 0, left = 0, right = 0, material = RegisterMaterial( "widg_lobby_arrow" ) } } } } }, { type = "UIElement", id = "popup_content", properties = { exclusiveController = MBh.Property( "exclusiveController" ) }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 0, right = 0, top = GenericTitleBarDims.TitleBarHeight, bottom = 0, spacing = 0 } }, children = { { type = "UIVerticalList", id = "friends_vlist", handlers = { focus_vlist = function ( f146_arg0, f146_arg1 ) f146_arg0:processEvent( { name = "lose_focus" } ) f146_arg0:clearSavedState() f146_arg0:processEvent( { name = "gain_focus" } ) end , wipe_vlist = function ( f147_arg0, f147_arg1 ) f147_arg0:closeChildren() f147_arg0:processEvent( { name = "lose_focus" } ) f147_arg0:clearSavedState() end }, properties = { exclusiveController = MBh.Property( "exclusiveController" ), noWrap = true, sendScrollEvents = true }, states = { default = { leftAnchor = true, rightAnchor = true, topAnchor = true, bottomAnchor = true, left = 4, right = -Friends.Constants.scrollbarWidth - 3, top = 3, bottom = -3, spacing = 4, alignment = LUI.Alignment.Center } }, childrenFeeder = MainFriendFeeder }, { type = "UIVerticalScrollbar", id = "scrollbar", properties = { on_move_func = function ( f148_arg0, f148_arg1, f148_arg2, f148_arg3 ) local f148_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f148_arg1 ) if f148_local0.total then f148_local0.slot_offset = math.floor( f148_arg2 * f148_local0.total ) f148_local0.slot_offset = LUI.clamp( f148_local0.slot_offset, 0, math.max( 0, f148_local0.total - f148_local0.maxButtonsOnPage ) ) f148_arg1:dispatchEventToRoot( { name = "friends_refresh", immediate = true } ) end end }, states = { default = { topAnchor = true, bottomAnchor = true, leftAnchor = false, rightAnchor = true, top = 3, bottom = -41, left = -Friends.Constants.scrollbarWidth, right = -4, alpha = 1 }, visible = { alpha = 1 }, hidden = { alpha = 0 } }, handlers = { hide_scrollbar = MBh.AnimateToState( "hidden", 0 ), show_scrollbar = MBh.AnimateToState( "visible", 0 ), init_scrollbar = function ( f149_arg0, f149_arg1 ) local f149_local0 = LUI.FlowManager.GetMenuScopedDataFromElement( f149_arg0 ) f149_arg0:manualUpdate( f149_local0.slot_offset, f149_local0.maxButtonsOnPage, f149_local0.total, Friends.Constants.FriendButtonHeight ) end }, children = { { type = "UITimer", properties = { event = "init_scrollbar", interval = 1, disposable = true, deferNextFrame = true } } } } } } } }, { type = "generic_back_button" }, { type = "UIBindButton", handlers = { button_left = function ( f150_arg0, f150_arg1 ) f150_arg0:dispatchEventToRoot( { name = "previous_page", controller = f150_arg1.controller, immediate = true } ) end , button_right = function ( f151_arg0, f151_arg1 ) f151_arg0:dispatchEventToRoot( { name = "next_page", controller = f151_arg1.controller, immediate = true } ) end , button_alt1 = ButtonAlt1Action, button_alt2 = ButtonAlt2Action, button_start = ButtonStartAction } } } } end LUI.MenuBuilder.registerDef( "popup_friends", friends_list ) LUI.MenuBuilder.registerDef( "popup_friend_list_actions", popup_friend_list_actions ) LUI.MenuBuilder.registerDef( "popup_friend_invite_sent", popup_friend_invite_sent ) LUI.MenuBuilder.registerDef( "popup_friend_report", popup_friend_report ) LUI.MenuBuilder.registerDef( "popup_confirm_report", popup_confirm_report ) LUI.MenuBuilder.registerDef( "popup_elite_clan_updating", popup_elite_clan_updating ) LUI.MenuBuilder.registerDef( "popup_update_clan_finished", popup_update_clan_finished ) LUI.MenuBuilder.registerDef( "popup_kick_are_you_sure", popup_kick_are_you_sure ) LUI.MenuBuilder.registerDef( "popup_transfer_are_you_sure", popup_transfer_are_you_sure ) LUI.MenuBuilder.registerDef( "popup_leave_are_you_sure", popup_leave_are_you_sure ) LUI.MenuBuilder.registerDef( "popup_leave_leader_are_you_sure", popup_leave_leader_are_you_sure ) LUI.MenuBuilder.registerDef( "popup_leave_leader_with_members", popup_leave_leader_with_members ) LUI.MenuBuilder.registerDef( "popup_change_status", popup_change_status ) LUI.MenuBuilder.registerDef( "popup_join_on_blocked_player_are_you_sure", popup_join_on_blocked_player_are_you_sure ) LockTable( _M )