Exemplo n.º 1
0
 public void SetCommunity(Community community)
 {
     this.m_community = community;
     this.m_headerCommunityText.text = community.Name.ToUpper();
     this.BuildContentPanel();
 }
 private void OpenChatPanel(Community community, CommunityStream stream)
 {
     this.m_communitiesChatPanel.SetActive(true);
     this.m_communitiesChatPanel.GetComponent <CommunityChatPanel>().InitializeChatContent(community, stream);
     this.m_communitiesListPanel.SetActive(false);
 }
        public void OnOpenEvent(Calendar.CalendarOpenEventEvent eventArgs)
        {
            Calendar.OnCalendarOpenEvent           -= new Calendar.CalendarOpenEventHandler(this.OnOpenEvent);
            base.GetComponent <CanvasGroup>().alpha = 1f;
            foreach (Selectable selectable in base.GetComponentsInChildren <Selectable>())
            {
                selectable.interactable = true;
            }
            CalendarEventInfo calendarEventInfo;

            if (!Calendar.GetEventInfo(ref calendarEventInfo))
            {
                this.CloseDialog();
                return;
            }
            this.m_eventTitle.text       = calendarEventInfo.title;
            this.m_eventDescription.text = calendarEventInfo.description;
            this.m_eventDateTime.text    = calendarEventInfo.time.ToDateTime().ToString(StaticDB.GetString("EVENT_DATE_AND_TIME", "M/d/yy h:mm tt"));
            if (this.CalendarEventItem.EventData.IsCommunityEvent)
            {
                Community community = CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID);
                this.m_communityName.text = ((community == null) ? string.Empty : community.Name);
            }
            else
            {
                this.m_communityName.text = string.Empty;
            }
            foreach (Button button in base.GetComponentsInChildren <Button>())
            {
                button.interactable = true;
            }
            bool flag = calendarEventInfo.time.ToDateTime() >= DateAndTime.GetServerTimeLocal();

            this.m_addInviteButton.interactable = flag;
            this.m_addInviteButton.gameObject.SetActive(this.CalendarEventItem.EventData.ModStatus == "CREATOR" || this.CalendarEventItem.EventData.ModStatus == "MODERATOR");
            if (!flag || calendarEventInfo.isLocked)
            {
                this.m_acceptButton.interactable    = false;
                this.m_tentativeButton.interactable = false;
                this.m_declineButton.interactable   = false;
            }
            else if (this.CalendarEventItem.EventData.IsCommunityEvent)
            {
                if (this.CalendarEventItem.EventData.ModStatus == "CREATOR")
                {
                    this.m_acceptButton.interactable    = false;
                    this.m_tentativeButton.interactable = false;
                    this.m_declineButton.interactable   = false;
                }
                else
                {
                    bool flag2 = (CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) == null) ? (calendarEventInfo.inviteStatus == 1u) : (calendarEventInfo.inviteStatus == 6u || calendarEventInfo.inviteStatus == 8u);
                    bool flag3 = (CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) == null) ? (calendarEventInfo.inviteStatus == 8u) : (calendarEventInfo.inviteStatus == 6u || calendarEventInfo.inviteStatus == 8u);
                    bool flag4 = (CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) == null) ? (calendarEventInfo.inviteStatus == 2u) : (calendarEventInfo.inviteStatus == 7u);
                    this.m_acceptButton.interactable    = !flag2;
                    this.m_tentativeButton.interactable = !flag3;
                    this.m_declineButton.interactable   = !flag4;
                }
            }
            else if (!CalendarStatusExtensions.CanRSVP(calendarEventInfo.inviteStatus))
            {
                this.m_acceptButton.interactable    = false;
                this.m_tentativeButton.interactable = false;
                this.m_declineButton.interactable   = false;
            }
            else
            {
                this.m_acceptButton.interactable    = (calendarEventInfo.inviteStatus != 1u);
                this.m_tentativeButton.interactable = (calendarEventInfo.inviteStatus != 8u);
                this.m_declineButton.interactable   = (calendarEventInfo.inviteStatus != 2u);
            }
            if (this.CalendarEventItem.EventData.IsCommunityEvent && CommunityData.Instance.GetCommunity(this.CalendarEventItem.EventData.ClubID) != null)
            {
                this.m_acceptButton.GetComponentInChildren <Text>().text  = StaticDB.GetString("EVENT_SIGN_UP", "SIGN UP [PH]");
                this.m_declineButton.GetComponentInChildren <Text>().text = StaticDB.GetString("EVENT_REMOVE_SIGN_UP", "REMOVE SIGN UP [PH]");
            }
            this.UpdateInvitesList();
        }
Exemplo n.º 4
0
 public void SetCommunity(Community community)
 {
     this.m_community          = community;
     this.m_communityName.text = community.Name.ToUpper();
     this.UpdateNotifications();
 }
Exemplo n.º 5
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);
         }
     }
 }