Ejemplo n.º 1
0
 public SetPricePrompt(RecipeBook book, RecipeScrollDefinition recipe, int page, List <RecipeScrollDefinition> list)
 {
     m_Book   = book;
     m_Recipe = recipe;
     m_Page   = page;
     m_List   = list;
 }
Ejemplo n.º 2
0
        public RecipeScrollFilterGump(Mobile from, RecipeBook book)
            : base(12, 24)
        {
            from.CloseGump(typeof(RecipeBookGump));
            from.CloseGump(typeof(RecipeScrollFilterGump));

            m_From = from;
            m_Book = book;

            RecipeScrollFilter f = book.Filter;

            AddPage(0);

            AddBackground(10, 10, 600, 375, 0x13BE);

            AddImageTiled(18, 20, 583, 356, 0xA40);
            AddAlphaRegion(18, 20, 583, 356);

            AddImage(0, 0, 0x28DC);
            AddImage(590, 0, 0x28DC);
            AddImage(0, 365, 0x28DC);
            AddImage(590, 365, 0x28DC);

            AddHtmlLocalized(26, 64, 120, 32, 1158816, TitleLabelColor, false, false);  // Crafting
            AddHtmlLocalized(270, 32, 200, 32, 1062223, TitleLabelColor, false, false); // Filter Preference

            AddHtmlLocalized(26, 64, 120, 32, 1158816, TitleLabelColor, false, false);  // Crafting
            AddFilterList(25, 96, m_XOffsets_Skill, 32, m_SkillFilters, 32, f.Skill, 0);

            AddHtmlLocalized(26, 192, 120, 42, 1158814, TitleLabelColor, false, false); // Expansion
            AddFilterList(25, 224, m_XOffsets_Expansion, 32, m_ExpansionFilters, 42, f.Expansion, 1);

            AddHtmlLocalized(26, 256, 120, 32, 1062217, TitleLabelColor, false, false); // Amount
            AddFilterList(25, 288, m_XOffsets_Amount, 32, m_AmountFilters, 32, f.Amount, 2);

            AddHtmlLocalized(75, 352, 120, 32, 1062477, (((PlayerMobile)from).UseOwnFilter ? LabelColor : 16927), false, false); // Set Book Filter
            AddButton(40, 352, 4005, 4007, 1, GumpButtonType.Reply, 0);

            AddHtmlLocalized(235, 352, 120, 32, 1062478, (((PlayerMobile)from).UseOwnFilter ? 16927 : LabelColor), false, false); // Set Your Filter
            AddButton(200, 352, 4005, 4007, 2, GumpButtonType.Reply, 0);

            AddHtmlLocalized(405, 352, 120, 32, 1062231, TitleLabelColor, false, false); // Clear Filter
            AddButton(370, 352, 4005, 4007, 3, GumpButtonType.Reply, 0);

            AddHtmlLocalized(540, 352, 50, 32, 1011046, TitleLabelColor, false, false); // APPLY
            AddButton(505, 352, 4017, 4018, 0, GumpButtonType.Reply, 0);
        }
Ejemplo n.º 3
0
        public RecipeScrollBuyGump(Mobile from, RecipeBook book, RecipeScrollDefinition recipe, int price)
            : base(100, 200)
        {
            m_From   = from;
            m_Book   = book;
            m_Recipe = recipe;
            m_Price  = price;

            AddPage(0);

            AddBackground(100, 10, 300, 150, 5054);

            AddHtmlLocalized(125, 20, 250, 24, 1019070, false, false); // You have agreed to purchase:
            AddHtmlLocalized(125, 45, 250, 24, 1074560, false, false); // recipe scroll

            AddHtmlLocalized(125, 70, 250, 24, 1019071, false, false); // for the amount of:
            AddLabel(125, 95, 0, price.ToString());

            AddButton(250, 130, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddHtmlLocalized(282, 130, 100, 24, 1011012, false, false); // CANCEL

            AddButton(120, 130, 4005, 4007, 2, GumpButtonType.Reply, 0);
            AddHtmlLocalized(152, 130, 100, 24, 1011036, false, false); // OKAY
        }
Ejemplo n.º 4
0
 public NameBookPrompt(RecipeBook book)
 {
     m_Book = book;
 }
Ejemplo n.º 5
0
 public NameBookEntry(Mobile from, RecipeBook book)
     : base(6216)
 {
     m_From = from;
     m_Book = book;
 }
Ejemplo n.º 6
0
        public RecipeBookGump(Mobile from, RecipeBook book, int page, List <RecipeScrollDefinition> list)
            : base(12, 24)
        {
            from.CloseGump(typeof(RecipeBookGump));
            from.CloseGump(typeof(RecipeScrollFilterGump));

            m_Book = book;
            m_Page = page;

            if (list == null)
            {
                list = new List <RecipeScrollDefinition>();

                m_Book.Recipes.ForEach(x =>
                {
                    if (CheckFilter(x))
                    {
                        list.Add(x);
                    }
                });
            }

            m_List = list;

            int index = GetIndexForPage(page);
            int count = GetCountForIndex(index);

            int tableIndex = 0;

            PlayerVendor pv = book.RootParent as PlayerVendor;

            bool canLocked = book.IsLockedDown;
            bool canDrop   = book.IsChildOf(from.Backpack);
            bool canBuy    = (pv != null);
            bool canPrice  = (canDrop || canBuy || canLocked);

            if (canBuy)
            {
                VendorItem vi = pv.GetVendorItem(book);

                canBuy = (vi != null && !vi.IsForSale);
            }

            int width = 600;

            if (!canPrice)
            {
                width = 516;
            }

            X = (624 - width) / 2;

            AddPage(0);

            AddBackground(10, 10, width, 439, 5054);
            AddImageTiled(18, 20, width - 17, 420, 2624);

            if (canPrice)
            {
                AddImageTiled(573, 64, 24, 352, 200);
                AddImageTiled(493, 64, 78, 352, 1416);
            }

            if (canDrop)
            {
                AddImageTiled(24, 64, 32, 352, 1416);
            }

            AddImageTiled(58, 64, 36, 352, 200);
            AddImageTiled(96, 64, 133, 352, 1416);
            AddImageTiled(231, 64, 80, 352, 200);
            AddImageTiled(313, 64, 100, 352, 1416);
            AddImageTiled(415, 64, 76, 352, 200);

            list = list.OrderBy(x => x.ID).ToList();

            for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
            {
                var recipe = list[i];

                if (!CheckFilter(recipe))
                {
                    continue;
                }

                AddImageTiled(24, 94 + (tableIndex * 32), canPrice ? 573 : 489, 2, 2624);

                ++tableIndex;
            }

            AddAlphaRegion(18, 20, width - 17, 420);
            AddImage(0, 0, 10460);
            AddImage(width - 15, 5, 10460);
            AddImage(0, 429, 10460);
            AddImage(width - 15, 429, 10460);

            AddHtmlLocalized(266, 32, 200, 32, 1158810, LabelColor, false, false); // Recipe Book

            AddHtmlLocalized(147, 64, 200, 32, 1062214, LabelColor, false, false); // Item
            AddHtmlLocalized(246, 64, 200, 32, 1158814, LabelColor, false, false); // Expansion
            AddHtmlLocalized(336, 64, 200, 32, 1158816, LabelColor, false, false); // Crafting
            AddHtmlLocalized(429, 64, 100, 32, 1062217, LabelColor, false, false); // Amount

            AddHtmlLocalized(70, 32, 200, 32, 1062476, LabelColor, false, false);  // Set Filter
            AddButton(35, 32, 4005, 4007, 1, GumpButtonType.Reply, 0);

            RecipeScrollFilter f = book.Filter;

            if (f.IsDefault)
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062475, 16927, false, false); // Using No Filter
            }
            else if (((PlayerMobile)from).UseOwnFilter)
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062451, 16927, false, false); // Using Your Filter
            }
            else
            {
                AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062230, 16927, false, false); // Using Book Filter
            }
            AddButton(375, 416, 4017, 4018, 0, GumpButtonType.Reply, 0);
            AddHtmlLocalized(410, 416, 120, 20, 1011441, LabelColor, false, false); // EXIT

            if (canDrop)
            {
                AddHtmlLocalized(26, 64, 50, 32, 1062212, LabelColor, false, false); // Drop
            }
            if (canPrice)
            {
                AddHtmlLocalized(516, 64, 200, 32, 1062218, LabelColor, false, false); // Price

                if (canBuy)
                {
                    AddHtmlLocalized(576, 64, 200, 32, 1062219, LabelColor, false, false); // Buy
                }
                else
                {
                    AddHtmlLocalized(576, 64, 200, 32, 1062227, LabelColor, false, false); // Set
                }
            }

            tableIndex = 0;

            if (page > 0)
            {
                AddButton(75, 416, 4014, 4016, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(110, 416, 150, 20, 1011067, LabelColor, false, false); // Previous page
            }

            if (GetIndexForPage(page + 1) < list.Count)
            {
                AddButton(225, 416, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(260, 416, 150, 20, 1011066, LabelColor, false, false); // Next page
            }

            for (int i = index; i < (index + count) && i >= 0 && i < list.Count; ++i)
            {
                var recipe = list[i];

                if (!CheckFilter(recipe) || !Recipe.Recipes.ContainsKey(recipe.RecipeID))
                {
                    continue;
                }

                int y = 96 + (tableIndex++ *32);

                if (recipe.Amount > 0 && (canDrop || canLocked))
                {
                    AddButton(35, y + 2, 5602, 5606, 4 + (i * 2), GumpButtonType.Reply, 0);
                }

                AddLabel(61, y, 0x480, string.Format("{0}", recipe.ID));
                AddHtmlLocalized(103, y, 130, 32, Recipe.Recipes[recipe.RecipeID].TextDefinition.Number, "#103221", 0xFFFFFF, false, false); // ~1_val~
                AddLabel(235, y, 0x480, GetExpansion(recipe.Expansion));
                AddHtmlLocalized(316, y, 100, 20, GetSkillName(recipe.Skill), "#104409", 0xFFFFFF, false, false);                            // ~1_val~
                AddLabel(421, y, 0x480, recipe.Amount.ToString());

                if (canDrop || (canBuy && recipe.Price > 0))
                {
                    AddButton(579, y + 2, 2117, 2118, 5 + (i * 2), GumpButtonType.Reply, 0);
                    AddLabel(495, y, 1152, recipe.Price.ToString("N0"));
                }
            }
        }
Ejemplo n.º 7
0
 public RecipeBookGump(Mobile from, RecipeBook book)
     : this(from, book, 0, null)
 {
 }