Example #1
0
 public static int IndexOf(PageEntry e)
 {
     return(m_List.IndexOf(e));
 }
        public PageEntryGump(Mobile m, PageEntry entry) : base(30, 30)
        {
            try
            {
                m_Mobile = m;
                m_Entry  = entry;

                int buttons = 0;

                int bottom = 356;

                AddPage(0);

                AddImageTiled(0, 0, 410, 456, 0xA40);
                AddAlphaRegion(1, 1, 408, 454);

                AddPage(1);

                AddLabel(18, 18, 2100, "Sent:");
                AddLabelCropped(128, 18, 264, 20, 2100, entry.Sent.ToString());

                AddLabel(18, 38, 2100, "Sender:");
                AddLabelCropped(128, 38, 264, 20, 2100, String.Format("{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map));

                AddButton(18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0);
                AddImageTiled(52, bottom - (buttons * 22) + 1, 340, 80, 0xA40 /*0xBBC*//*0x2458*/);
                AddImageTiled(53, bottom - (buttons * 22) + 2, 338, 78, 0xBBC /*0x2426*/);
                AddTextEntry(55, bottom - (buttons++ *22) + 2, 336, 78, 0x480, 0, "");

                AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
                AddLabel(52, bottom - (buttons++ *22), 2100, "Predefined Response");

                if (entry.Sender != m)
                {
                    AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Sender");
                }

                AddLabel(18, 58, 2100, "Handler:");

                if (entry.Handler == null)
                {
                    AddLabelCropped(128, 58, 264, 20, 2100, "Unhandled");

                    AddButton(18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "Delete Page");

                    AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "Handle Page");
                }
                else
                {
                    AddLabelCropped(128, 58, 264, 20, m_AccessLevelHues[(int)entry.Handler.AccessLevel], entry.Handler.Name);

                    if (entry.Handler != m)
                    {
                        AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0);
                        AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Handler");
                    }
                    else
                    {
                        AddButton(18, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0);
                        AddLabel(52, bottom - (buttons++ *22), 2100, "Abandon Page");

                        AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0);
                        AddLabel(52, bottom - (buttons++ *22), 2100, "Page Handled");
                    }
                }

                AddLabel(18, 78, 2100, "Page Location:");
                AddLabelCropped(128, 78, 264, 20, 2100, String.Format("{0} [{1}]", entry.PageLocation, entry.PageMap));

                AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
                AddLabel(52, bottom - (buttons++ *22), 2100, "Go to Page Location");

                if (entry.SpeechLog != null)
                {
                    AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 10, GumpButtonType.Reply, 0);
                    AddLabel(52, bottom - (buttons++ *22), 2100, "View Speech Log");
                }

                AddLabel(18, 98, 2100, "Page Type:");
                AddLabelCropped(128, 98, 264, 20, 2100, PageQueue.GetPageTypeName(entry.Type));

                AddLabel(18, 118, 2100, "Message:");
                AddHtml(128, 118, 250, 100, entry.Message, true, true);

                AddPage(2);

                ArrayList preresp = PredefinedResponse.List;

                AddButton(18, 18, 0xFAE, 0xFB0, 0, GumpButtonType.Page, 1);
                AddButton(410 - 18 - 32, 18, 0xFAB, 0xFAC, 9, GumpButtonType.Reply, 0);

                if (preresp.Count == 0)
                {
                    AddLabel(52, 18, 2100, "There are no predefined responses.");
                }
                else
                {
                    AddLabel(52, 18, 2100, "Back");

                    for (int i = 0; i < preresp.Count; ++i)
                    {
                        AddButton(18, 40 + (i * 22), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0);
                        AddLabel(52, 40 + (i * 22), 2100, ((PredefinedResponse)preresp[i]).Title);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Example #3
0
 public InternalTimer(PageEntry entry) : base(TimeSpan.FromSeconds(1.0), StatusDelay)
 {
     m_Entry = entry;
 }