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(); }
public void OnEventDetailsOpened(Calendar.CalendarOpenEventEvent eventArgs) { this.m_gears.gameObject.SetActive(false); this.m_gears.transform.SetParent(base.gameObject.transform.parent, false); Calendar.OnCalendarOpenEvent -= new Calendar.CalendarOpenEventHandler(this.OnEventDetailsOpened); }
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(); }