private IEnumerator Start() { base.GetComponent <CanvasGroup>().alpha = 0f; while (Calendar.IsActionPending()) { yield return(null); } while (this.EventData == null) { yield return(null); } base.GetComponent <CanvasGroup>().alpha = 1f; int offsetMonth = this.EventData.EventTime.Month - DateAndTime.GetServerTimeLocal().Month; CalendarHolidayInfo eventInfo; if (!Calendar.GetHolidayInfo(offsetMonth, (uint)(this.EventData.EventTime.Day - 1), this.EventData.EventIndex, ref eventInfo)) { this.CloseDialog(); yield break; } this.m_title.text = eventInfo.name; this.m_description.text = eventInfo.description; this.m_date.text = this.EventData.StartTime.ToString(StaticDB.GetString("EVENT_DATE_AND_TIME", "M/d/yy h:mm tt")) + " - " + this.EventData.EndTime.ToString(StaticDB.GetString("EVENT_DATE_AND_TIME", "M/d/yy h:mm tt")); yield break; }
public bool OpenEvent(Calendar.CalendarOpenEventHandler callback) { Calendar.OnCalendarOpenEvent += callback; if (!Calendar.OpenEvent(this.EventData.StartTime.Month - DateAndTime.GetServerTimeLocal().Month, (uint)(this.EventData.StartTime.Day - 1), this.EventIndex)) { Calendar.OnCalendarOpenEvent -= callback; return(false); } return(true); }
private IEnumerator GetInvitesCoroutine() { this.m_addInviteButton.GetComponent <Button>().interactable = false; bool acceptInteractable = this.m_acceptButton.interactable; bool tentativeInteractable = this.m_tentativeButton.interactable; bool declineInteractable = this.m_declineButton.interactable; this.m_acceptButton.interactable = false; this.m_tentativeButton.interactable = false; this.m_declineButton.interactable = false; while (!Calendar.AreNamesReady() || Calendar.IsActionPending()) { yield return(null); } this.m_invites.Clear(); for (uint num = 0u; num < Calendar.GetNumInvites(); num += 1u) { CalendarEventInviteInfo key2; if (Calendar.EventGetInvite(num, ref key2)) { this.m_invites.Add(key2, num); } } IOrderedEnumerable <CalendarEventInviteInfo> invites = this.m_invites.Keys.OrderBy((CalendarEventInviteInfo key) => key, EventInviteResponseDialog.Sorter); foreach (EventRosterPage eventRosterPage in this.m_inviteListScrollArea.GetComponentsInChildren <EventRosterPage>()) { Object.Destroy(eventRosterPage.gameObject); } while (base.GetComponentsInChildren <EventRosterPage>().Length > 0) { yield return(null); } EventRosterPage currentMemberPage = this.CreateRosterPage(); foreach (CalendarEventInviteInfo invite in invites) { if (currentMemberPage.AtCapacity()) { currentMemberPage = this.CreateRosterPage(); } currentMemberPage.AddMemberToRoster(invite); yield return(null); } this.m_inviteListScrollArea.GetComponentInParent <AutoCenterScrollRect>().CenterOnItem(0); bool isTodayOrLater = this.CalendarEventItem.EventData.EventTime >= DateAndTime.GetServerTimeLocal(); this.m_addInviteButton.GetComponent <Button>().interactable = isTodayOrLater; this.m_acceptButton.interactable = acceptInteractable; this.m_tentativeButton.interactable = tentativeInteractable; this.m_declineButton.interactable = declineInteractable; yield break; }
public bool IsPendingInvite() { return(CalendarStatusExtensions.IsInvited(new uint?(this.InviteStatus)) && this.StartTime >= DateAndTime.GetServerTimeLocal() && (this.CalendarType == CalendarType.Player || this.CalendarType == CalendarType.GuildSignup || this.CalendarType == CalendarType.CommunitySignup)); }
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(); }