Example #1
0
        public MasterRunebookGump(Mobile owner, MasterRunebook book)
            : base(150, 60)
        {
            m_Book = book;
            AddPage(0);
            AddBackground(0, 0, 420, 440, 3500);
            AddItem(66, 14, 0x2252, m_Book.Hue);
            AddLabel(110, 14, 0, "Lokai's Master Runebook");
            AddItem(260, 14, 0x2252, m_Book.Hue);

            int count = 0;

            for (int x = 0; x < 3; x++)
            {
                AddPage(1 + x);
                if (x < 2)
                {
                    AddButton(338, 407, 2471, 2470, 0, GumpButtonType.Page, 2 + x); //Next Button
                }
                if (x > 0)
                {
                    AddButton(30, 407, 2468, 2467, 0, GumpButtonType.Page, x); // Previous Button
                }
                int XposB = 15, YposB = 44, XposL = 35, YposL = 41, bk = 16;
                for (int y = 0; y < 17; y++)
                {
                    string name = "";
                    try { name = m_Book.Books[count].Name.Trim(); }
                    catch { }
                    if (name == null || name.Length < 1)
                    {
                        name = string.Format("Book #{0}", ((int)(count + 1)).ToString());
                    }
                    AddTextEntry(XposL, YposL, 320, 19, 0, count + 100, name);
                    AddButton(XposB, YposB, 1802, 1802, bk, GumpButtonType.Reply, 0);
                    AddItem(XposB - 13, YposB - 4, 8901, 0x461);
                    YposB += 20;
                    YposL += 20;
                    count++;
                    bk++;
                }
                XposB += 130;
                XposL += 130;
                YposB  = 44;
                YposL  = 41;
            }
        }
        public InternalRunebookGump(Mobile from, InternalRunebook book, MasterRunebook masterbook, int booknum)
            : base(150, 200)
        {
            m_Book       = book;
            m_MasterBook = masterbook;
            m_BookNum    = booknum;

            AddBackground();

            AddLabel(137, 12, 0, m_Book.Name);
            AddLabel(312, 32, 0, "Return");
            AddButton(288, 34, 2223, 2223, 199, GumpButtonType.Reply, 0);

            if (booknum > 0)
            {
                AddButton(283, 14, 9766, 9767, booknum + 199, GumpButtonType.Reply, 0);
                AddLabel(303, 12, 0, string.Format("{0}", ((int)(booknum)).ToString()));
            }
            if (booknum < 50)
            {
                AddButton(407, 14, 9762, 9763, booknum + 201, GumpButtonType.Reply, 0);
                AddLabel(387, 12, 0, string.Format("{0}", ((int)(booknum + 2)).ToString()));
            }

            AddIndex();

            for (int page = 0; page < 8; ++page)
            {
                AddPage(2 + page);

                //AddButton(125, 14, 2205, 2205, 0, GumpButtonType.Page, 1 + page);

                //if (page < 7)
                //    AddButton(393, 14, 2206, 2206, 0, GumpButtonType.Page, 3 + page);

                for (int half = 0; half < 2; ++half)
                {
                    AddDetails((page * 2) + half, half);
                }
            }
        }
 public static void TargetPoint3D_Callback(Mobile from, bool okay, MasterRunebook master, InternalRunebook book, int id)
 {
     if (okay)
     {
         if (book.Entries.Count < 16)
         {
             book.Entries.Add(new RunebookEntry(from.Location, from.Map, "", null));
             from.SendMessage("Enter the description for this location.");
             from.Prompt = new DescriptionPrompt(master, book, id);
         }
         else
         {
             from.SendLocalizedMessage(502401); // This runebook is full.
             from.CloseGump(typeof(InternalRunebookGump));
             from.SendGump(new InternalRunebookGump(from, book, master, id));
         }
     }
     else
     {
         from.CloseGump(typeof(InternalRunebookGump));
         from.SendGump(new InternalRunebookGump(from, book, master, id));
     }
 }
 public DescriptionPrompt(MasterRunebook master, InternalRunebook book, int id)
 {
     m_Master = master;
     m_Book   = book;
     m_Id     = id;
 }