public static bool IsActive(EventType type) { SeasonalEventEntry entry = GetEntry(type); if (entry != null) { return(entry.IsActive()); } return(false); }
public override void AddGumpLayout() { AddBackground(0, 0, 500, 600, 9300); AddHtml(0, 10, 500, 20, Center("Season Event Configuration"), false, false); int y = 60; AddHtml(10, 40, 190, 20, "System Name", false, false); AddHtml(200, 40, 75, 20, "Status", false, false); AddHtml(275, 40, 150, 20, "Season", false, false); AddHtml(450, 40, 50, 20, "Edit", false, false); for (int i = 0; i < SeasonalEventSystem.Entries.Count; i++) { SeasonalEventEntry entry = SeasonalEventSystem.Entries[i]; int hue = entry.IsActive() ? 167 : 137; AddLabel(10, y, hue, entry.Name); AddLabel(200, y, hue, entry.Status.ToString()); if (entry.Status != EventStatus.Seasonal) { AddLabel(275, y, hue, "N/A"); } else { DateTime end = new DateTime(DateTime.Now.Year, entry.MonthStart, entry.DayStart, 0, 0, 0) + TimeSpan.FromDays(entry.Duration); AddLabel(275, y, hue, String.Format("{0}/{1} - {2}/{3}", entry.MonthStart.ToString(), entry.DayStart.ToString(), end.Month.ToString(), end.Day.ToString())); } AddButton(450, y, 4029, 4030, i + 10, GumpButtonType.Reply, 0); y += 25; } AddButton(10, 568, 4017, 4018, 1, GumpButtonType.Reply, 0); AddHtml(45, 568, 150, 20, "Restore Defaults", false, false); }