public CraftRequestGump(int page, CraftRequestVendor 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) { AddHtml(264, 80, 200, 24, "Order Request", false, false); AddHtml(120, 108, 420, 48, "Please enter your request", 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); } } } }
public DismissCRVendorEntry(CraftRequestVendor vendor) : base(6129, 12) { m_vendor = vendor; }
public DismissCRVendorEntry( CraftRequestVendor vendor ) : base( 6129, 12 ) { m_vendor = vendor; }
public override void OnDoubleClick( Mobile from ) { if ( !IsChildOf( from.Backpack ) ) { from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it. } else if ( from.AccessLevel >= AccessLevel.GameMaster ) { from.SendLocalizedMessage( 503248 ); // Your godly powers allow you to place this vendor whereever you wish. CraftRequestVendor v = new CraftRequestVendor(); v.Direction = from.Direction & Direction.Mask; v.MoveToWorld( from.Location, from.Map ); v.Owner = from; v.Say( "I am ready to take your orders!" ); this.Delete(); } else { BaseHouse house = BaseHouse.FindHouseAt( from ); if ( house == null ) { from.SendLocalizedMessage( 503240 ); // Vendors can only be placed in houses. } else if ( !BaseHouse.NewVendorSystem && !house.IsFriend( from ) ) { from.SendLocalizedMessage( 503242 ); // You must ask the owner of this building to name you a friend of the household in order to place a vendor here. } else if ( BaseHouse.NewVendorSystem && !house.IsOwner( from ) ) { from.SendLocalizedMessage( 1062423 ); // Only the house owner can directly place vendors. Please ask the house owner to offer you a vendor contract so that you may place a vendor in this house. } else if ( !house.Public || !house.CanPlaceNewVendor() ) { from.SendLocalizedMessage( 503241 ); // You cannot place this vendor or barkeep. Make sure the house is public and has sufficient storage available. } else { bool vendor, contract; BaseHouse.IsThereVendor( from.Location, from.Map, out vendor, out contract ); if ( vendor ) { from.SendLocalizedMessage( 1062677 ); // You cannot place a vendor or barkeep at this location. } else if ( contract ) { from.SendLocalizedMessage( 1062678 ); // You cannot place a vendor or barkeep on top of a rental contract! } else { CraftRequestVendor v = new CraftRequestVendor(); v.Direction = from.Direction & Direction.Mask; v.MoveToWorld( from.Location, from.Map ); v.Owner = from; v.Say( "I am ready to take your orders!" ); this.Delete(); } } } }
public CraftRequestGump( int page, CraftRequestVendor 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 ) { AddHtml( 264, 80, 200, 24, "Order Request", false, false ); AddHtml( 120, 108, 420, 48, "Please enter your request", 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 ); } } } }