Пример #1
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);
                }
            }
        }
Пример #2
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);
         }
     }
 }