public override void PopulateMemberInfo(CalendarEventInviteInfo invite)
        {
            this.m_memberInfo    = invite;
            this.m_nameText.text = invite.name;
            ChrClassesRec recordFirstOrDefault = StaticDB.chrClassesDB.GetRecordFirstOrDefault((ChrClassesRec rec) => rec.Name.Equals(invite.className, StringComparison.OrdinalIgnoreCase));

            if (recordFirstOrDefault != null)
            {
                this.m_classIcon.sprite = GeneralHelpers.LoadClassIcon(new uint?((uint)recordFirstOrDefault.ID));
            }
            if (invite.inviteIsMine)
            {
                this.m_classIconRing.sprite = this.m_goldRingSprite;
            }
            if (invite.modStatus == "CREATOR")
            {
                this.m_ownerIcon.gameObject.SetActive(true);
            }
            else if (invite.modStatus == "MODERATOR")
            {
                this.m_moderatorIcon.gameObject.SetActive(true);
            }
            this.m_checkMark.gameObject.SetActive(CalendarStatusExtensions.IsAttending(invite.inviteStatus));
            this.m_questionMark.gameObject.SetActive(invite.inviteStatus == 8u);
            this.m_xMark.gameObject.SetActive(invite.inviteStatus == 2u);
        }
Exemplo n.º 2
0
 private void UpdateNumAttendees()
 {
     if (!CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)))
     {
         return;
     }
     base.StartCoroutine(this.UpdateNumAttendeesCoroutine());
 }
Exemplo n.º 3
0
        private void SetNumAttendees(uint numAttendees)
        {
            this.m_numAttendees = new uint?(numAttendees);
            TextCycler textCycler = (!(this.m_subtext != null)) ? null : this.m_subtext.GetComponent <TextCycler>();

            if (textCycler != null && CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)) && this.m_numAttendees.Value > 1u)
            {
                textCycler.ClearStrings();
                TextCycler textCycler2   = textCycler;
                string     @string       = StaticDB.GetString("YOU_PLUS_PEOPLE_ARE_GOING", "You +{0} are going. [PH]");
                uint?      numAttendees2 = this.m_numAttendees;
                textCycler2.AddString(string.Format(@string, (numAttendees2 == null) ? null : new uint?(numAttendees2.GetValueOrDefault() - 1u)));
                Community community = CommunityData.Instance.GetCommunity(this.EventData.ClubID);
                if (community != null)
                {
                    textCycler.AddString(community.Name);
                }
            }
        }
Exemplo n.º 4
0
 public void SetEventInfo(CalendarEventData eventData)
 {
     this.EventData   = eventData;
     this.m_date.text = this.GetDateString(eventData.EventTime);
     if (this.m_time != null)
     {
         this.m_time.text = eventData.EventTime.ToString(StaticDB.GetString("SHORT_TIME", "h:mm tt"));
     }
     this.m_eventName.text = eventData.Title;
     if (this.m_subtext != null)
     {
         TextCycler component = this.m_subtext.GetComponent <TextCycler>();
         Community  community = CommunityData.Instance.GetCommunity(this.EventData.ClubID);
         if (this.EventData.CalendarType == CalendarType.CommunityAnnouncement)
         {
             if (community != null)
             {
                 component.AddString(community.Name);
             }
         }
         else if (CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)))
         {
             component.AddString(StaticDB.GetString("YOU_ARE_GOING", "You are going [PH]"));
             if (community != null)
             {
                 component.AddString(community.Name);
             }
             this.UpdateNumAttendees();
         }
         else if (this.EventData.InviteStatus == 8u)
         {
             component.AddString(StaticDB.GetString("TENTATIVE", "Tentative [PH]"));
             if (community != null)
             {
                 component.AddString(community.Name);
             }
         }
         else if (CalendarStatusExtensions.IsInvited(new uint?(this.EventData.InviteStatus)))
         {
             if (!string.IsNullOrEmpty(this.EventData.InvitedBy))
             {
                 component.AddString(string.Format(StaticDB.GetString("INVITED_BY", "Invited by {0} [PH]"), this.EventData.InvitedBy));
             }
             else
             {
                 component.AddString(StaticDB.GetString("REPLY_TO_EVENT", "Reply to this event [PH]"));
             }
             if (community != null)
             {
                 component.AddString(community.Name);
             }
         }
         else if (this.EventData.InviteStatus == 2u)
         {
             component.AddString(StaticDB.GetString("DECLINED", "You are not going [PH]"));
         }
         else
         {
             this.m_subtext.gameObject.SetActive(false);
         }
     }
     if (this.m_inviteStatus != null)
     {
         if (CalendarStatusExtensions.IsAttending(new uint?(this.EventData.InviteStatus)))
         {
             this.m_inviteStatus.sprite = this.m_checkMark;
         }
         else if (this.EventData.InviteStatus == 8u)
         {
             this.m_inviteStatus.sprite = this.m_questionMark;
         }
         else if (CalendarStatusExtensions.IsInvited(new uint?(this.EventData.InviteStatus)))
         {
             this.m_inviteStatus.sprite = this.m_exclamationMark;
         }
         else if (this.EventData.InviteStatus == 2u)
         {
             this.m_inviteStatus.sprite = this.m_xMark;
         }
         else
         {
             this.m_inviteStatus.gameObject.SetActive(false);
         }
     }
 }
Exemplo n.º 5
0
        private void OnOpenEvent(Calendar.CalendarOpenEventEvent eventArgs)
        {
            Calendar.OnCalendarOpenEvent -= new Calendar.CalendarOpenEventHandler(this.OnOpenEvent);
            List <CalendarEventInviteInfo> list = new List <CalendarEventInviteInfo>();

            for (uint num = 0u; num < Calendar.GetNumInvites(); num += 1u)
            {
                CalendarEventInviteInfo item;
                if (Calendar.EventGetInvite(num, ref item))
                {
                    list.Add(item);
                }
            }
            this.SetNumAttendees((uint)list.Count((CalendarEventInviteInfo invite) => CalendarStatusExtensions.IsAttending(invite.inviteStatus)));
            Calendar.CloseEvent();
        }