public EntryGump(AutoStartStruct ass) : base(true) { m_Struct = ass; Closable = false; Disposable = false; AddBackground(0, 0, 500, 443, 9200); AddBackground(150, 15, 200, 50, 9200); AddHtml(0, 18, 500, 18, Center("Timed Events"), false, false); AddHtml(0, 38, 500, 18, Center("Single Entry"), false, false); AddLabel(65, 90, 0, "Event:"); AddLabel(125, 90, 0, (ass.Event == null || ass.Event.Deleted) ? "null" : ass.Event.GetType().Name); AddLabel(65, 115, 0, "Name:"); AddTextEntry(125, 115, 150, 20, 0, 0, ass.Name); AddLabel(65, 140, 0, "Hour:"); AddTextEntry(125, 140, 79, 20, 0, 1, ass.Hour.ToString()); AddLabel(65, 165, 0, "Minute:"); AddTextEntry(125, 165, 79, 20, 0, 2, ass.Minute.ToString()); int count = 0; foreach (bool b in ass.Days) { AddCheck(65, 190 + count * 25, 210, 211, b, count); AddLabel(100, 190 + count * 25, 0, ((DayOfWeek)count).ToString()); count++; } AddButton(16, 406, 4020, 4006, 0, GumpButtonType.Reply, 0); AddLabel(56, 407, 0, "Remove"); AddButton(423, 406, 247, 248, 1, GumpButtonType.Reply, 0); }
private static void Deserialize(GenericReader reader) { int version = reader.ReadInt(); int count = reader.ReadInt(); for (int i = 0; i < count; i++) { AutoStartStruct ass = new AutoStartStruct(reader); if(ass.Event != null && !ass.Event.Deleted) m_Enlisted.Add(ass); } }
public static void AddNewTimedEvent(AutoStartStruct ass) { m_Enlisted.Add(ass); m_Enlisted.Sort(); }