Ejemplo n.º 1
0
        public override void AddGumpLayout()
        {
            AddImage(0, 0, 39923);

            AddHtmlLocalized(60, 8, 180, 16, 1060728, String.Format("{0}\t{1}", Atlas.CurCharges, Atlas.MaxCharges), 1, false, false); //charges: ~1_val~ / ~2_val~

            AddHtmlLocalized(265, 8, 150, 16, 1011299, false, false);                                                                  // rename book
            AddButton(250, 12, 2103, 2103, 1, GumpButtonType.Reply, 0);

            int startIndex = Page * 16;
            int index      = 0;

            for (int i = startIndex; i < startIndex + 16; i++)
            {
                string desc;
                int    hue;

                if (i < Atlas.Entries.Count)
                {
                    desc = RunebookGump.GetName(Atlas.Entries[i].Description);
                    hue  = Selected == i ? 0x90 : RunebookGump.GetMapHue(Atlas.Entries[i].Map);
                }
                else
                {
                    desc = "Empty";
                    hue  = 0;
                }

                // Select Button
                AddButton(45 + ((index / 8) * 205), 64 + ((index % 8) * 20), 2103, 2104, i + 100, GumpButtonType.Reply, 0);

                // Description label
                AddLabelCropped(60 + ((index / 8) * 205), 60 + ((index % 8) * 20), 115, 17, hue, desc);

                index++;
            }

            if (Selected >= 0 && Selected < Atlas.Entries.Count)
            {
                RunebookEntry entry = Atlas.Entries[Selected];

                if (entry != null)
                {
                    string coords = ToCoordinates(entry.Location, entry.Map);

                    if (coords != "unknown")
                    {
                        AddHtml(40, 250, 155, 16, String.Format("<center>{0}</center>", coords), false, false);
                    }

                    AddHtmlLocalized(70, 291, 150, 16, 1011300, false, false); // Set default

                    if (Atlas.DefaultIndex != Selected)
                    {
                        AddButton(45, 295, 2103, 2103, 2, GumpButtonType.Reply, 0);
                    }

                    AddHtmlLocalized(70, 311, 150, 16, 1011298, false, false); // drop rune
                    AddButton(45, 315, 2103, 2103, 3, GumpButtonType.Reply, 0);

                    AddHtml(25, 345, 180, 16, String.Format("<center>{0}</center>", entry.Description), false, false);

                    AddHtmlLocalized(280, 286, 100, 16, 1077595, false, false); // Recall (Spell)
                    AddButton(265, 290, 2103, 2103, 4, GumpButtonType.Reply, 0);

                    AddHtmlLocalized(280, 303, 100, 16, 1077594, false, false); // Recall (Charge)
                    AddButton(265, 307, 2103, 2103, 5, GumpButtonType.Reply, 0);

                    AddHtmlLocalized(280, 320, 100, 16, 1015214, false, false); // Gate Travel
                    AddButton(265, 324, 2103, 2103, 6, GumpButtonType.Reply, 0);

                    AddHtmlLocalized(280, 337, 100, 16, 1060502, false, false); // Sacred Journey
                    AddButton(265, 341, 2103, 2103, 7, GumpButtonType.Reply, 0);
                }
            }

            if (Page < 2)
            {
                AddButton(374, 3, 2206, 2206, 1150, GumpButtonType.Reply, 0);
            }

            if (Page > 0)
            {
                AddButton(23, 5, 2205, 2205, 1151, GumpButtonType.Reply, 0);
            }
        }
Ejemplo n.º 2
0
        public PenOfWisdomGump(Mobile from, PenOfWisdom pen, Runebook sourcebook, Runebook copybook, List <RunebookEntry> list)
            : base(50, 50)
        {
            Container bp = from.Backpack;

            Pen              = pen;
            SourceBook       = sourcebook;
            CopyBook         = copybook;
            MarkScrollAmount = bp.GetAmount(typeof(MarkScroll), true);
            RuneAmount       = bp.GetAmount(typeof(RecallRune), true);
            Blank            = copybook.MaxEntries - copybook.Entries.Count;

            if (list == null)
            {
                Checked = new List <RunebookEntry>();
            }
            else
            {
                Checked = list;
            }

            Closable   = false;
            Disposable = true;
            Dragable   = true;

            int entrycount = SourceBook.Entries.Count;

            int y = entrycount <= 16 ? 0 : 25;

            AddPage(0);

            AddBackground(4, 39, 391, 313 + y, 9200);
            AddImageTiled(8, 45, 380, 53, 2624);

            AddHtmlLocalized(7, 50, 380, 53, 1115428, string.Format("@{0}@{1}@{2}@{3}", MarkScrollAmount.ToString(), RuneAmount.ToString(), Checked.Count, Blank.ToString()), EntryColor, false, false); // <CENTER>Pen of Wisdom<br>(Mark Scrolls: ~1_VAL~, Runes: ~2_VAL~ | Selected: ~3_VAL~, Blank: ~4_VAL~)</CENTER>

            AddImageTiled(8, 101, 188, 220, 2624);
            AddImageTiled(199, 101, 188, 220, 2624);

            AddButton(12, 325 + y, 4017, 4018, 20, GumpButtonType.Reply, 0);
            AddHtmlLocalized(48, 326 + y, 78, 20, 1006045, EntryColor, false, false); // Cancel

            AddButton(153, 325 + y, 4011, 4012, 21, GumpButtonType.Reply, 0);
            AddHtmlLocalized(189, 326 + y, 78, 20, 1115427, EntryColor, false, false); // Select All

            AddButton(309, 325 + y, 4023, 4024, 22, GumpButtonType.Reply, 0);
            AddHtmlLocalized(344, 326 + y, 78, 20, 1156596, EntryColor, false, false); // Okay

            string description;

            int page = 1;
            int yy   = 0;

            AddPage(page);

            for (int i = 0; i < entrycount; i++)
            {
                if (page > 1)
                {
                    AddButton(50, 325, 4014, 4015, 0, GumpButtonType.Page, page - 1);
                    AddHtmlLocalized(85, 326, 150, 20, 1011067, EntryColor, false, false); // Previous page
                }

                description = SourceBook.Entries[i].Description;

                if (description == null)
                {
                    if (i + 1 < 10)
                    {
                        description = "0" + (i + 1).ToString();
                    }
                    else
                    {
                        description = (i + 1).ToString();
                    }
                }

                if (yy < 8)
                {
                    AddButton(15, 110 + (yy * 25), Checked.Contains(SourceBook.Entries[i]) ? 211 : 210, Checked.Contains(SourceBook.Entries[i]) ? 210 : 211, i, GumpButtonType.Reply, 0);
                    AddLabelCropped(45, 110 + (yy * 25), 115, 17, RunebookGump.GetMapHue(SourceBook.Entries[i].Map), string.Format("{0}", description));
                }
                else
                {
                    AddButton(205, 110 + ((yy - 8) * 25), Checked.Contains(SourceBook.Entries[i]) ? 211 : 210, Checked.Contains(SourceBook.Entries[i]) ? 210 : 211, i, GumpButtonType.Reply, 0);
                    AddLabelCropped(235, 110 + ((yy - 8) * 25), 115, 17, RunebookGump.GetMapHue(SourceBook.Entries[i].Map), string.Format("{0}", description));
                }

                yy++;

                bool pages = (i + 1) % 16 == 0;

                if (pages && entrycount - 1 != i)
                {
                    AddButton(200, 325, 4005, 4006, 0, GumpButtonType.Page, page + 1);
                    AddHtmlLocalized(235, 326, 150, 20, 1011066, EntryColor, false, false); // Next page
                    page++;
                    AddPage(page);
                    yy = 0;
                }
            }
        }
Ejemplo n.º 3
0
        public PenOfWisdomGump(Mobile from, PenOfWisdom pen, Runebook sourcebook, Runebook copybook, List <RunebookEntry> list) : base(50, 50)
        {
            Container bp = from.Backpack;

            m_Pen              = pen;
            m_SourceBook       = sourcebook;
            m_CopyBook         = copybook;
            m_MarkScrollAmount = bp.GetAmount(typeof(MarkScroll), true);
            m_RuneAmount       = bp.GetAmount(typeof(RecallRune), true);
            m_Blank            = copybook.MaxEntries - copybook.Entries.Count;

            if (list == null)
            {
                m_Checked = new List <RunebookEntry>();
            }
            else
            {
                m_Checked = list;
            }

            Closable   = false;
            Disposable = true;
            Dragable   = true;

            AddPage(0);
            AddBackground(4, 39, 391, 313, 9200);
            AddImageTiled(8, 45, 380, 53, 2624);
            AddHtmlLocalized(7, 50, 380, 53, 1115428, String.Format("{0}\t{1}\t{2}\t{3}", m_MarkScrollAmount.ToString(), m_RuneAmount.ToString(), m_Checked.Count, m_Blank.ToString()), 0xFFFFFF, false, false); // <CENTER>Pen of Wisdom<br>(Mark Scrolls: ~1_VAL~, Runes: ~2_VAL~ | Selected: ~3_VAL~, Blank: ~4_VAL~)</CENTER>

            AddImageTiled(8, 101, 188, 220, 2624);
            AddImageTiled(199, 101, 188, 220, 2624);
            AddButton(12, 325, 4017, 4018, 20, GumpButtonType.Reply, 0);
            AddLabel(48, 325, 2100, @"Cancel");
            AddButton(153, 325, 4011, 4012, 21, GumpButtonType.Reply, 0);
            AddHtmlLocalized(189, 325, 78, 22, 1115427, 0xFFFFFF, false, false); // Select All
            AddButton(309, 325, 4023, 4024, 22, GumpButtonType.Reply, 0);
            AddLabel(344, 325, 2100, @"Okay");

            string description;

            for (int i = 0; i < sourcebook.Entries.Count; i++)
            {
                description = sourcebook.Entries[i].Description;

                if (description == null)
                {
                    if (i + 1 < 10)
                    {
                        description = "0" + (i + 1).ToString();
                    }
                    else
                    {
                        description = (i + 1).ToString();
                    }
                }

                if (i < 8)
                {
                    AddButton(15, 110 + i * 25, m_Checked.Contains(sourcebook.Entries[i]) ? 211 : 210, m_Checked.Contains(sourcebook.Entries[i]) ? 210 : 211, i, GumpButtonType.Reply, 0);
                    AddLabel(45, 110 + i * 25, RunebookGump.GetMapHue(sourcebook.Entries[i].Map), String.Format("{0}", description));
                }
                else
                {
                    AddButton(205, 110 + ((i - 8) * 25), m_Checked.Contains(sourcebook.Entries[i]) ? 211 : 210, m_Checked.Contains(sourcebook.Entries[i]) ? 210 : 211, i, GumpButtonType.Reply, 0);
                    AddLabel(235, 110 + ((i - 8) * 25), RunebookGump.GetMapHue(sourcebook.Entries[i].Map), String.Format("{0}", description));
                }
            }
        }