public DoYouWantToFulfillABuyOrderGump(PlayerMobile from, object item, String market) : base(20, 30) { m_From = from; m_Market = market; m_item = item; AddBackground(0, 0, 270, 190, 5054); AddBackground(10, 10, 250, 170, 3000); CancelAllGumpsAndPrompts.Run(from); AddHtml(20, 15, 240, 130, "There is a buy order available for your " + m_item.GetType().Name + ". Press continue to open the Buy Order menu to see the details - or cancel to proceed to post this sell order.", true, true); AddHtmlLocalized(55, 150, 75, 20, 1011011, false, false); // CONTINUE AddButton(20, 150, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(170, 150, 75, 20, 1011012, false, false); // CANCEL AddButton(135, 150, 4005, 4007, 2, GumpButtonType.Reply, 0); }
public PurchaseSellOrderGump(PlayerMobile from, MarketDatabase.SellOrder order, String market, int amount) : base(20, 30) { m_From = from; m_Order = order; m_Market = market; m_amountToBuy = amount; AddBackground(0, 0, 270, 150, 5054); AddBackground(10, 10, 250, 130, 3000); CancelAllGumpsAndPrompts.Run(from); int totalCost = m_amountToBuy * order.unitPrice; AddHtml(20, 15, 240, 90, "Are you sure you wish to purchase (" + m_amountToBuy + ") " + order.itemType.Name + " for the sum of " + totalCost + " gold?", true, true); AddHtmlLocalized(55, 110, 75, 20, 1011011, false, false); // CONTINUE AddButton(20, 110, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(170, 110, 75, 20, 1011012, false, false); // CANCEL AddButton(135, 110, 4005, 4007, 2, GumpButtonType.Reply, 0); }
public MarketItemBuySearchGump(Mobile from, string searchString, int page, List <MarketDatabase.SellOrder> searchResults, String Market) : base(50, 50) { m_SearchString = searchString; m_SearchResults = searchResults; m_Page = page; m_Market = Market; if (m_SearchString == "" && m_Page == 0 && m_SearchResults.Count == 0) { m_SearchResults = SearchForObjectTypes(MarketDatabase.GetAllSellOrderTypes(m_Market), m_Market); } CancelAllGumpsAndPrompts.Run(from); AddPage(0); AddBackground(0, 0, 420, 330 /*310/*280*/, 5054); AddLabel(10, 6, 0x480, "Viewing the \"" + m_Market + "\" market's orders of sale."); AddImageTiled(10, 30, 400, 20, 2624); AddAlphaRegion(10, 30, 400, 20); AddImageTiled(41, 31, 184, 18, 0xBBC); AddImageTiled(42, 32, 182, 16, 2624); AddAlphaRegion(42, 32, 182, 16); AddButton(10, 29, 4011, 4013, 1, GumpButtonType.Reply, 0); AddTextEntry(44, 30, 180, 20, 0x480, 0, m_SearchString); AddHtmlLocalized(230, 30, 100, 20, 3010005, 0x7FFF, false, false); AddButton(110, 300, 4011, 4013, 4, GumpButtonType.Reply, 0); AddLabel(140, 300, 0x480, "Click here to sell something!"); AddImageTiled(10, 60, 400, 200, 2624); AddAlphaRegion(10, 60, 400, 200); if (m_SearchResults.Count > 0) { for (int i = (m_Page * 10); i < ((m_Page + 1) * 10) && i < m_SearchResults.Count; ++i) { int index = i % 10; AddLabel(44, 59 + (index * 20), 0x480, m_SearchResults[i].itemType.Name); AddLabel(184, 59 + (index * 20), 0x480, "x" + m_SearchResults[i].amount); AddLabel(254, 59 + (index * 20), 0x480, "" + m_SearchResults[i].unitPrice + " gold each"); AddButton(10, 59 + (index * 20), 4005, 4007, 5 + i, GumpButtonType.Reply, 0); } } else { if (m_SearchString == "") { AddLabel(15, 64, 0x480, "Enter a name of an item or animal to search for."); } else { Type t = ScriptCompiler.FindTypeByName(String.Join("", m_SearchString.Split(' '))); if (t == null) { AddLabel(15, 64, 0x480, "No item or animal with that name was found."); } else { AddLabel(15, 64, 0x480, "Searched for " + t.Name + " and found none."); } } } AddImageTiled(10, 270, 400, 20, 2624); AddAlphaRegion(10, 270, 400, 20); if (m_Page > 0) { AddButton(10, 269, 4014, 4016, 2, GumpButtonType.Reply, 0); } else { AddImage(10, 269, 4014); } AddHtmlLocalized(44, 270, 170, 20, 1061028, m_Page > 0 ? 0x7FFF : 0x5EF7, false, false); // Previous page if (((m_Page + 1) * 10) < m_SearchResults.Count) { AddButton(210, 269, 4005, 4007, 3, GumpButtonType.Reply, 0); } else { AddImage(210, 269, 4005); } AddHtmlLocalized(244, 270, 170, 20, 1061027, ((m_Page + 1) * 10) < m_SearchResults.Count ? 0x7FFF : 0x5EF7, false, false); // Next page }
public ItemTypeSelectGump(Mobile from, string searchString, int page, List <Type> searchResults, String Market, bool explicitSearch) : base(50, 50) { m_SearchString = searchString; m_SearchResults = searchResults; m_Market = Market; m_Page = page; CancelAllGumpsAndPrompts.Run(from); AddPage(0); AddBackground(0, 0, 420, 300, 5054); AddLabel(10, 6, 0x480, "Identify what type of object you wish to purchase."); AddImageTiled(10, 50, 400, 20, 2624); AddAlphaRegion(10, 50, 400, 20); AddImageTiled(10, 30, 400, 20, 2624); AddAlphaRegion(10, 30, 400, 20); AddImageTiled(41, 31, 184, 18, 0xBBC); AddImageTiled(42, 32, 182, 16, 2624); AddAlphaRegion(42, 32, 182, 16); AddButton(10, 29, 4011, 4013, 1, GumpButtonType.Reply, 0); AddTextEntry(44, 30, 180, 20, 0x480, 0, searchString); AddHtmlLocalized(230, 30, 100, 20, 3010005, 0x7FFF, false, false); AddImageTiled(10, 60, 400, 200, 2624); AddAlphaRegion(10, 60, 400, 200); if (searchResults.Count > 0) { for (int i = (page * 10); i < ((page + 1) * 10) && i < searchResults.Count; ++i) { int index = i % 10; AddLabel(44, 59 + (index * 20), 0x480, AddSpacesToNames.Format(searchResults[i].Name)); AddButton(10, 59 + (index * 20), 4023, 4025, 4 + i, GumpButtonType.Reply, 0); } } else { AddLabel(15, 64, 0x480, explicitSearch ? "Nothing matched your search terms." : "No results to display."); } AddImageTiled(10, 270, 400, 20, 2624); AddAlphaRegion(10, 270, 400, 20); if (m_Page > 0) { AddButton(10, 269, 4014, 4016, 2, GumpButtonType.Reply, 0); } else { AddImage(10, 269, 4014); } AddHtmlLocalized(44, 270, 170, 20, 1061028, m_Page > 0 ? 0x7FFF : 0x5EF7, false, false); // Previous page if (((m_Page + 1) * 10) < searchResults.Count) { AddButton(210, 269, 4005, 4007, 3, GumpButtonType.Reply, 0); } else { AddImage(210, 269, 4005); } AddHtmlLocalized(244, 270, 170, 20, 1061027, ((m_Page + 1) * 10) < searchResults.Count ? 0x7FFF : 0x5EF7, false, false); // Next page }
public UserAccountSearchGump(Mobile from, int page, List <MarketUserContainer.OrderRecord> searchResults, String Market) : base(50, 50) { m_SearchResults = (searchResults != null) ? searchResults : MarketUserContainer.GetUserOrders(from, Market); m_Page = page; m_Market = Market; CancelAllGumpsAndPrompts.Run(from); AddPage(0); AddBackground(0, 0, 420, 270, 5054); AddLabel(10, 6, 0x480, "Viewing your account for the \"" + m_Market + "\" market."); AddImageTiled(10, 30, 400, 200, 2624); AddAlphaRegion(10, 30, 400, 200); if (m_SearchResults.Count > 0) { for (int i = (page * 10); i < ((page + 1) * 10) && i < m_SearchResults.Count; ++i) { int index = i % 10; AddLabel(44, 29 + (index * 20), 0x480, (m_SearchResults[i].m_type == 1) ? "Sell" : "Buy"); AddLabel(70, 29 + (index * 20), 0x480, m_SearchResults[i].m_itemType.Name); int amountToShow = (m_SearchResults[i].m_type == 1) ? m_SearchResults[i].m_amountCurrent : (m_SearchResults[i].m_amountStart - m_SearchResults[i].m_amountCurrent); AddLabel(184, 29 + (index * 20), 0x480, m_SearchResults[i].m_unitPrice + "gp, " + amountToShow + "/" + m_SearchResults[i].m_amountStart + " %" + m_SearchResults[i].PercentComplete() + " complete."); //AddLabel(254, 59 + (index * 20), 0x480, "" + searchResults[i].unitPrice + " gold each"); AddButton(10, 29 + (index * 20), 4005, 4007, 5 + i, GumpButtonType.Reply, 0); } } else { AddLabel(15, 34, 0x480, "You currently have no buy or sell orders."); } AddImageTiled(10, 240, 400, 20, 2624); AddAlphaRegion(10, 240, 400, 20); if (m_Page > 0) { AddButton(10, 239, 4014, 4016, 2, GumpButtonType.Reply, 0); } else { AddImage(10, 239, 4014); } AddHtmlLocalized(44, 240, 170, 20, 1061028, m_Page > 0 ? 0x7FFF : 0x5EF7, false, false); // Previous page if (((m_Page + 1) * 10) < m_SearchResults.Count) { AddButton(210, 239, 4005, 4007, 3, GumpButtonType.Reply, 0); } else { AddImage(210, 239, 4005); } AddHtmlLocalized(244, 240, 170, 20, 1061027, ((m_Page + 1) * 10) < m_SearchResults.Count ? 0x7FFF : 0x5EF7, false, false); // Next page }