Example #1
0
        public GiftRequestGump(int page, ChristmasVendor vendor, Mobile asker, ref Dictionary <Mobile, string> Order) : base(0, 0)
        {
            m_asker  = asker;
            m_vendor = vendor;
            order    = Order;
            m_page   = page;


            AddBackground(50, 50, 540, 350, 2600);
            AddPage(0);


            if (m_asker != m_vendor.Owner && m_asker.AccessLevel == AccessLevel.Player)
            {
                AddHtml(264, 80, 200, 24, "Santa's List", false, false);
                AddHtml(120, 108, 420, 48, "What do you want for Christmas?", false, false);

                AddBackground(100, 148, 440, 200, 3500);
                AddTextEntry(120, 168, 400, 200, 1153, 0, "");

                AddButton(175, 355, 2074, 2075, 1, GumpButtonType.Reply, 0);                   // Okay
                AddButton(405, 355, 2073, 2072, 0, GumpButtonType.Reply, 0);                   // Cancel
            }

            else
            {
                m_vendor.NewOrders = false;
                int           buttonindex = 100;
                int           textvert    = 122;
                int           buttonvert  = 122;
                int           pages;
                List <Mobile> names = new List <Mobile>(order.Keys);
                pages = (names.Count / 4);
                if ((names.Count % 4) > 0)
                {
                    pages += 1;
                }
                AddLabel(276, 82, 1160, "Orders");

                if (order != null && names != null && names.Count > 0)
                {
                    int counter = ((m_page - 1) * 4);
                    for (int i = counter; ((i < (counter + 4)) && (i < names.Count)); i++)
                    {
                        if (i == counter)
                        {
                            AddButton(76, buttonvert, 4017, 4018, (i + buttonindex), GumpButtonType.Reply, 0);
                            AddHtml(114, textvert, 422, 51, String.Format("{0} - {1}", names[i].Name, order[names[i]]), false, true);
                        }
                        else
                        {
                            buttonvert += 60;
                            textvert   += 62;
                            AddButton(76, buttonvert, 4017, 4018, (i + buttonindex), GumpButtonType.Reply, 0);
                            AddHtml(114, textvert, 422, 51, String.Format("{0} - {1}", names[i].Name, order[names[i]]), false, true);
                        }
                    }
                    if ((names.Count > 4) && (m_page != pages))
                    {
                        AddButton(448, 84, 2469, 2470, 2, GumpButtonType.Reply, 0);
                    }
                    if (m_page > 1)
                    {
                        AddButton(103, 84, 2466, 2467, 3, GumpButtonType.Reply, 0);
                    }
                }
            }
        }
Example #2
0
 public DismissCVendorEntry(ChristmasVendor vendor) : base(6129, 12)
 {
     m_vendor = vendor;
 }