GetPageTypeName() public static method

public static GetPageTypeName ( PageType type ) : string
type PageType
return string
Esempio n. 1
0
        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");

                        if (m.AccessLevel >= AccessLevel.Seer) //Taran: Seers and above can always delete pages
                        {
                            AddButton(18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0);
                            AddLabel(52, bottom - (buttons++ *22), 2100, "Delete Page");
                        }
                    }
                    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);
            }
        }
Esempio n. 2
0
        public PageEntryGump(Mobile m, PageEntry entry) : base(30, 30)
        {
            m_Mobile = m;
            m_Entry  = entry;

            var buttons = 0;

            var 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,
                $"{entry.Sender.RawName} {entry.Sender.Location} [{entry.Sender.Map}]"
                );

            AddButton(18, bottom - buttons * 22, 0xFAB, 0xFAD, 8);
            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);
                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);
                AddLabel(52, bottom - buttons++ *22, 2100, "Delete Page");

                AddButton(18, bottom - buttons * 22, 0xFB7, 0xFB9, 4);
                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);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Go to Handler");
                }
                else
                {
                    AddButton(18, bottom - buttons * 22, 0xFA2, 0xFA4, 6);
                    AddLabel(52, bottom - buttons++ *22, 2100, "Abandon Page");

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

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

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

            if (entry.SpeechLog != null)
            {
                AddButton(18, bottom - buttons * 22, 0xFA5, 0xFA7, 10);
                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);

            var preresp = PredefinedResponse.List;

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

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

                for (var i = 0; i < preresp.Count; ++i)
                {
                    AddButton(18, 40 + i * 22, 0xFA5, 0xFA7, 100 + i);
                    AddLabel(52, 40 + i * 22, 2100, preresp[i].Title);
                }
            }
        }
Esempio n. 3
0
        public PageQueueGump(Mobile m)
            : base(30, 30)
        {
            Add(new GumpPage(0));

            if (m != null && m.NetState != null && m.NetState.IsEnhancedClient)
            {
                AddBackground(1, 1, 408, 446, 9300);
            }
            else
            {
                Add(new GumpImageTiled(0, 0, 410, 448, 0xA40));
                Add(new GumpAlphaRegion(1, 1, 408, 446));
            }

            Add(new GumpLabel(180, 12, 2100, "Page Queue"));

            ArrayList list = PageQueue.List;

            for (int i = 0; i < list.Count;)
            {
                PageEntry e = (PageEntry)list[i];

                if (e.Sender.Deleted)
                {
                    e.AddResponse(e.Sender, "[Logout]");
                    PageQueue.Remove(e);
                }
                else
                {
                    ++i;
                }
            }

            m_List = (PageEntry[])list.ToArray(typeof(PageEntry));

            if (m_List.Length > 0)
            {
                Add(new GumpPage(1));

                for (int i = 0; i < m_List.Length; ++i)
                {
                    PageEntry e = m_List[i];

                    if (i >= 5 && (i % 5) == 0)
                    {
                        AddButton(368, 12, 0xFA5, 0xFA7, 0, GumpButtonType.Page, (i / 5) + 1);
                        Add(new GumpLabel(298, 12, 2100, "Next Page"));
                        Add(new GumpPage((i / 5) + 1));
                        AddButton(12, 12, 0xFAE, 0xFB0, 0, GumpButtonType.Page, (i / 5));
                        Add(new GumpLabel(48, 12, 2100, "Previous Page"));
                    }

                    string typeString = PageQueue.GetPageTypeName(e.Type);

                    string html = String.Format("[{0}] {1} <basefont color=#{2:X6}>[<u>{3}</u>]</basefont>", typeString, e.Message, e.Handler == null ? 0xFF0000 : 0xFF, e.Handler == null ? "Unhandled" : "Handling");

                    Add(new GumpHtml(12, 44 + ((i % 5) * 80), 350, 70, html, true, true));
                    AddButton(370, 44 + ((i % 5) * 80) + 24, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0);
                }
            }
            else
            {
                Add(new GumpLabel(12, 44, 2100, "The page queue is empty."));
            }
        }
Esempio n. 4
0
        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, 486, 2624);
                AddAlphaRegion(0, 0, 410, 486);

                AddPage(1);

                AddHtml(18, 18, 110, 20, Color("Sent", LabelColor32), false, false);
                AddHtml(128, 18, 264, 20, Color(entry.Sent.ToString(), LabelColor32), false, false);

                AddHtml(18, 38, 110, 20, Color("Sender", LabelColor32), false, false);
                AddHtml(128, 38, 264, 20, Color(String.Format("{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map), LabelColor32), false, false);

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

                AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 0, GumpButtonType.Page, 2);
                AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Predefined Response", LabelColor32), false, false);

                if (entry.Sender != m)
                {
                    AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0);
                    AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Go to Sender", LabelColor32), false, false);
                }

                AddHtml(18, 58, 110, 20, Color("Handler:", LabelColor32), false, false);

                if (entry.Handler == null)
                {
                    AddHtml(128, 58, 264, 20, Color("Unhandled", LabelColor32), false, false);

                    AddButton(18, bottom - (buttons * 22), 0xFB1, 0xFB3, 5, GumpButtonType.Reply, 0);
                    AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Delete Page", LabelColor32), false, false);

                    AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 4, GumpButtonType.Reply, 0);
                    AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Handle Page", LabelColor32), false, false);
                }
                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);
                        AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Go to Handler", LabelColor32), false, false);
                    }
                    else
                    {
                        AddButton(18, bottom - (buttons * 22), 0xFA2, 0xFA4, 6, GumpButtonType.Reply, 0);
                        AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Abandon Page", LabelColor32), false, false);

                        AddButton(18, bottom - (buttons * 22), 0xFB7, 0xFB9, 7, GumpButtonType.Reply, 0);
                        AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Page Handled", LabelColor32), false, false);
                    }
                }

                AddHtml(18, 78, 110, 20, Color("Page Location:", LabelColor32), false, false);
                AddHtml(128, 78, 264, 20, Color(String.Format("{0} [{1}]", entry.PageLocation, entry.PageMap), LabelColor32), false, false);

                AddButton(18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0);
                AddHtml(52, bottom - (buttons++ *22), 200, 20, Color("Go to Page Location", LabelColor32), false, false);

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

                AddHtml(18, 98, 110, 20, Color("Page Type:", LabelColor32), false, false);
                AddHtml(128, 98, 264, 20, Color(PageQueue.GetPageTypeName(entry.Type), LabelColor32), false, false);

                AddHtml(18, 118, 110, 20, Color("Message:", LabelColor32), false, false);
                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)
                {
                    AddHtml(52, 18, 300, 20, Color("There are no predefined responses.", LabelColor32), false, false);
                }
                else
                {
                    AddHtml(52, 18, 200, 20, Color("Back", LabelColor32), false, false);

                    for (int i = 0; i < preresp.Count; ++i)
                    {
                        AddButton(18, 40 + (i * 22), 0xFA5, 0xFA7, 100 + i, GumpButtonType.Reply, 0);
                        AddHtml(52, 40 + (i * 22), 200, 20, Color(((PredefinedResponse)preresp[i]).Title, LabelColor32), false, false);
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }