Ejemplo n.º 1
0
        public override void Init(object data)
        {
            SquadTeammateInteractionTooltipContentData data2 = (SquadTeammateInteractionTooltipContentData)data;

            this.teammateEntity = data2.teammateEntity;
            this.changeAvatarButton.gameObject.SetActive(!data2.ShowProfileButton);
            this.profileButton.gameObject.SetActive(data2.ShowProfileButton);
            this.leaveSquadButton.gameObject.SetActive(data2.ShowLeaveSquadButton);
            this.removeFromSquadButton.gameObject.SetActive(data2.ShowRemoveFromSquadButton);
            this.removeFromSquadButton.interactable = data2.ActiveRemoveFromSquadButton;
            this.giveLeaderButton.gameObject.SetActive(data2.ShowGiveLeaderButton);
            this.giveLeaderButton.interactable = data2.ActiveGiveLeaderButton;
            this.addFriendButton.gameObject.SetActive(data2.ShowAddFriendButton);
            this.friendRequestSentButton.gameObject.SetActive(data2.ShowFriendRequestSentButton);
        }
Ejemplo n.º 2
0
        public void ShowTooltip(UserNode user, SelfUserNode selfUser, SquadTeammateInteractionButtonComponent squadTeammateInteractionButton, FriendsComponent friends)
        {
            SquadTeammateInteractionTooltipContentData data;
            SquadTeammateInteractionTooltipContentData data2;
            bool flag2 = selfUser.Entity.HasComponent <SquadLeaderComponent>();
            bool flag3 = user.Entity.HasComponent <AcceptedFriendComponent>();
            bool flag4 = selfUser.Entity.HasComponent <MatchMakingUserComponent>();
            bool flag5 = friends.OutgoingFriendsIds.Contains(user.Entity.Id);

            if (user.Entity.HasComponent <SelfUserComponent>())
            {
                if (flag4)
                {
                    return;
                }
                data2 = new SquadTeammateInteractionTooltipContentData {
                    teammateEntity       = user.Entity,
                    ShowLeaveSquadButton = true
                };
                data = data2;
            }
            else
            {
                data2 = new SquadTeammateInteractionTooltipContentData {
                    teammateEntity              = user.Entity,
                    ShowProfileButton           = true,
                    ShowLeaveSquadButton        = false,
                    ShowRemoveFromSquadButton   = !flag4,
                    ActiveRemoveFromSquadButton = flag2,
                    ShowGiveLeaderButton        = !flag4,
                    ActiveGiveLeaderButton      = flag2,
                    ShowAddFriendButton         = !flag3 && !flag5,
                    ShowFriendRequestSentButton = !flag3 && flag5
                };
                data = data2;
            }
            TooltipController.Instance.ShowTooltip(Input.mousePosition, data, squadTeammateInteractionButton.tooltipPrefab, false);
        }