Пример #1
0
 // Token: 0x06006109 RID: 24841 RVA: 0x00223D6C File Offset: 0x0022216C
 public void SetupElement(QuickMenuSocialElement e)
 {
     base.gameObject.SetActive(true);
     this.ClearElement();
     this.user          = e.user;
     this.userName.text = e.user.displayName;
     this.image.texture = e.image.texture;
     this.SetIcon(e.currentIcon, this.user.id);
     this.elementType = e.elementType;
 }
Пример #2
0
    // Token: 0x06006102 RID: 24834 RVA: 0x002236E0 File Offset: 0x00221AE0
    private void SetupNotifications()
    {
        Action <List <ApiNotification> > SetupNotifs = delegate(List <ApiNotification> notifs)
        {
            List <ApiNotification> notificationsOfType4 = NotificationManager.Instance.GetNotificationsOfType(ApiNotification.NotificationType.VoteToKick, NotificationManager.HistoryRange.Local);
            notifs.AddRange(notificationsOfType4);
            int num = 0;
            for (int i = 0; i < this.elements.Length; i++)
            {
                if (num < notifs.Count)
                {
                    ApiNotification apiNotification = notifs[num];
                    if (apiNotification.notificationType == ApiNotification.NotificationType.Friendrequest)
                    {
                        apiNotification.message = apiNotification.senderUsername + " would like to be your friend";
                    }
                    if (this.elements[i].elementType == QuickMenuSocialElement.ElementType.Empty || this.elements[i].elementType == QuickMenuSocialElement.ElementType.Notification)
                    {
                        QuickMenuSocialElement.IconType iconTypeForNotificationType = QuickMenuSocialElement.GetIconTypeForNotificationType(apiNotification.notificationType);
                        this.elements[i].SetupElement(apiNotification, iconTypeForNotificationType);
                        num++;
                    }
                }
            }
        };
        List <ApiNotification> priority             = NotificationManager.Instance.GetNotificationsOfType(ApiNotification.NotificationType.Halp, NotificationManager.HistoryRange.Recent);
        List <ApiNotification> notificationsOfType  = NotificationManager.Instance.GetNotificationsOfType(ApiNotification.NotificationType.Invite, NotificationManager.HistoryRange.Recent);
        List <ApiNotification> notificationsOfType2 = NotificationManager.Instance.GetNotificationsOfType(ApiNotification.NotificationType.Requestinvite, NotificationManager.HistoryRange.Recent);
        List <ApiNotification> notificationsOfType3 = NotificationManager.Instance.GetNotificationsOfType(ApiNotification.NotificationType.Friendrequest, NotificationManager.HistoryRange.Recent);

        priority.AddRange(notificationsOfType);
        priority.AddRange(notificationsOfType2);
        priority.AddRange(notificationsOfType3);
        SetupNotifs(priority);
        if (this.dontFetchNotificationsForOnePeriod)
        {
            this.dontFetchNotificationsForOnePeriod = false;
        }
        else
        {
            NotificationManager.Instance.FetchNotifications(NotificationManager.HistoryRange.Recent, delegate(List <ApiNotification> notifs)
            {
                notifs.RemoveAll((ApiNotification x) => x.notificationType == ApiNotification.NotificationType.Hidden);
                IEnumerable <string> source = (from x in priority
                                               select x.id).Except(from x in notifs
                                                                   select x.id);
                bool flag = source.Count <string>() > 0 || priority.Count != notifs.Count;
                if (flag)
                {
                    SetupNotifs(notifs);
                }
            });
        }
    }