public void CheckForShowContextMenuButtons(CheckForShowInviteToSquadEvent e, FriendNode friend, [JoinByUser] Optional <UserInSquadNode> friendSquadUser, [JoinAll] Optional <SelfUserInSquadNode> selfUserInSquad, [JoinBySquad] Optional <SquadNode> squad, [JoinAll] SelfUserNode selfUser) { bool flag2 = friend.Entity.HasComponent <MatchMakingUserComponent>(); bool flag3 = friend.Entity.HasComponent <BattleGroupComponent>(); if (!selfUser.Entity.HasComponent <MatchMakingUserComponent>() && (!flag2 && !flag3)) { bool flag4 = selfUserInSquad.IsPresent(); bool flag5 = false; bool flag6 = friend.Entity.HasComponent <UserOnlineComponent>(); bool flag7 = friendSquadUser.IsPresent(); bool flag8 = (flag7 && flag4) && (friendSquadUser.Get().squadGroup.Key == squad.Get().squadGroup.Key); if (flag4 && squad.IsPresent()) { flag5 = base.Select <UserInSquadNode>(squad.Get().Entity, typeof(SquadGroupComponent)).Count >= (squad.Get().squadConfig.MaxSquadSize - 1); } e.ShowInviteToSquadButton = ((!flag4 || !flag5) && (!flag7 && flag6)) && (selfUser.userRank.Rank > 3); e.ActiveInviteToSquadButton = true; e.ShowRequestToInviteToSquadButton = (!flag4 && (flag7 && !flag8)) && (selfUser.userRank.Rank > 3); } }
public void SortListAndHideEmptyListNotification(NodeAddedEvent e, FriendUINode friendUI, [JoinByUser] FriendNode friend, [JoinAll] SingleNode <InviteFriendsListComponent> inviteFriendsList) { List <string> friendsUids = inviteFriendsList.component.FriendsUids; friendsUids.Add(friend.userUid.Uid); friendsUids.Sort(StringComparer.Ordinal); friendUI.inviteFriendListItem.transform.SetSiblingIndex(friendsUids.IndexOf(friend.userUid.Uid)); inviteFriendsList.component.EmptyListNotification.SetActive(false); }
public void ShowTooltipInLobby(RightMouseButtonClickEvent e, FriendLabelNode userButton, [JoinByUser] FriendNode friend, [JoinByUser] Optional <UserInBattleNode> userInBattle, [JoinAll] SingleNode <SelfUserComponent> selfUser) { bool flag = friend.Entity.HasComponent <AcceptedFriendComponent>(); bool flag2 = selfUser.Entity.HasComponent <UserAdminComponent>(); CheckForSpectatorButtonShowEvent eventInstance = new CheckForSpectatorButtonShowEvent(); base.ScheduleEvent(eventInstance, friend); CheckForShowInviteToSquadEvent event3 = new CheckForShowInviteToSquadEvent(); base.ScheduleEvent(event3, friend); FriendInteractionTooltipData data = new FriendInteractionTooltipData { FriendEntity = friend.Entity, ShowRemoveButton = flag, ShowEnterAsSpectatorButton = (userInBattle.IsPresent() && (flag || flag2)) && eventInstance.CanGoToSpectatorMode, ShowInviteToSquadButton = event3.ShowInviteToSquadButton, ActiveShowInviteToSquadButton = event3.ActiveInviteToSquadButton, ShowRequestToSquadButton = event3.ShowRequestToInviteToSquadButton, ShowChatButton = friend.Entity.HasComponent <UserOnlineComponent>() }; TooltipController.Instance.ShowTooltip(Input.mousePosition, data, userButton.friendInteractionButton.tooltipPrefab, false); }