public TokenVendorStoneBuyGump( VSShopper shopper, TokenVendorStone stone ) : base(125, 125) { m_Shopper = shopper; m_Stone = stone; m_Stone.CloseGumps( m_Shopper.Owner ); AddPage( 0 ); AddBackground( 0, 0, 375, 210, 0x2436 ); AddLabel( 12, 17, 5, "Your Buy List" ); AddLabel( 110, 22, 5, "Total Purchase: "+m_Shopper.TotalPrice() ); AddButton( 15, 160, 4005, 4007, 0, GumpButtonType.Reply, 0 ); AddLabel( 45, 160, 33, "Back" ); AddButton( 110, 160, 4005, 4007, 1, GumpButtonType.Reply, 0 ); AddLabel( 140, 160, 1152, "Buy" ); for ( int i = 0; i < m_Shopper.ItemList.Count; ++i ) { int item = (int)m_Shopper.ItemList[i]; if ( (i % 5) == 0 ) { if ( i != 0 ) { AddButton( 190, 235, 0x1196, 0x1196, 1152, GumpButtonType.Page, (i / 5) + 1 ); AddLabel( 190, 220, 1152, "Next page" ); } AddPage( (i / 5) + 1 ); if ( i != 0 ) { AddButton( 10, 235, 0x119a, 0x119a, 1152, GumpButtonType.Page, (i / 5) ); AddLabel( 10, 220, 1152, "Previous page" ); } } VSItem vsi = (VSItem)m_Stone.ItemList[item]; string blessbond = (vsi.BlessBond ? "(B)" : ""); AddButton( 13, 40 + ((i % 5) * 20), 0x26AF, 0x26B1, i+2, GumpButtonType.Reply, 0 ); if ( m_Stone.Currency.ToLower() == "daat99tokens" ) AddLabel( 40, 40 + ((i % 5) * 20), 1152, vsi.Amount+" "+vsi.Name+" "+blessbond+" "+vsi.Price+" Token Ledger Tokens" ); else AddLabel( 40, 40 + ((i % 5) * 20), 1152, vsi.Amount+" "+vsi.Name+" "+blessbond+" "+vsi.Price+" "+m_Stone.Currency ); } }
public VendorGump( VSShopper shopper, TokenVendorStone stone ) : base(25, 25) { m_Stone = stone; m_Shopper = shopper; m_Stone.CloseGumps( m_Shopper.Owner ); AddPage( 0 ); AddBackground( 0, 0, 550, 480, 0x2436 ); AddAlphaRegion( 10, 10, 530, 460 ); AddImageTiled( 10, 40, 530, 5, 2624 ); AddImageTiled( 10, 58, 390, 5, 2624 ); AddImageTiled( 90, 40, 5, 430, 2624 ); AddImageTiled( 125, 40, 5, 430, 2624 ); AddImageTiled( 160, 40, 5, 430, 2624 ); AddImageTiled( 310, 40, 5, 430, 2624 ); AddImageTiled( 400, 40, 5, 430, 2624 ); if ( m_Stone.Name != null && m_Stone.Name != "" ) AddHtml( 10, 10, 510, 20, Color( Center( m_Stone.Name ), 0xFFFFFF ), false, false ); else AddHtml( 10, 10, 510, 20, Color( Center( "Vendor Stone" ), 0xFFFFFF ), false, false ); AddLabel( 420, 60, 5, "Stone Currency:" ); if ( m_Stone.Currency.ToLower() == "daat99tokens" ) AddLabel( 420, 80, 5, "Token Ledger" ); else if ( m_Stone.Currency != null ) AddLabel( 420, 80, 5, m_Stone.Currency ); else AddLabel( 420, 80, 33, "None" ); AddHtml( 10, 42, 85, 20, Color( Center( "Item Amount" ), 0xFFFFFF ), false, false ); AddHtml( 95, 42, 30, 20, Color( Center( ((m_Stone.EditMode && shopper.Owner.AccessLevel >= m_Stone.AccessLevel) ? "Edit" : "Buy") ), 0xFFFFFF ), false, false ); AddHtml( 130, 42, 30, 20, Color( Center( "Des" ), 0xFFFFFF ), false, false ); AddHtml( 165, 42, 145, 20, Color( Center( "Item" ), 0xFFFFFF ), false, false ); AddHtml( 315, 42, 85, 20, Color( Center( "Price" ), 0xFFFFFF ), false, false ); if ( !m_Stone.EditMode ) { AddButton( 420, 120, 1209, 1210, 1, GumpButtonType.Reply, 0 ); AddLabel( 440, 120, 1152, "Buy Items" ); } AddLabel( 410, 160, 1152, "The (B) beside" ); AddLabel( 410, 175, 1152, "items and creatures" ); AddLabel( 410, 190, 1152, "stands for blessing" ); AddLabel( 410, 205, 1152, "or bonding." ); AddLabel( 420, 400, 906, "Created By" ); AddLabel( 420, 420, 906, "~Raelis~" ); AddButton( 420, 440, 4005, 4007, 0, GumpButtonType.Reply, 0 ); AddLabel( 450, 440, 33, "Close" ); int index = 0; int page = 1; AddPage( 1 ); for ( int i = 0; i < m_Stone.ItemList.Count; ++i ) { if ( index >= AmountPerPage ) { AddButton( 420, 365, 0x1196, 0x1196, 1152, GumpButtonType.Page, page + 1 ); AddLabel( 420, 350, 1152, "Next page" ); ++page; index = 0; AddPage( page ); AddButton( 420, 315, 0x119a, 0x119a, 1152, GumpButtonType.Page, page - 1 ); AddLabel( 420, 300, 1152, "Previous page" ); } int price = ((VSItem)m_Stone.ItemList[i]).Price; int amount = ((VSItem)m_Stone.ItemList[i]).Amount; string gumpname = ((VSItem)m_Stone.ItemList[i]).Name; AddLabel( 165, 60 + (index * 20), 1152, gumpname +( ((VSItem)m_Stone.ItemList[i]).BlessBond ? " (B)" : "") ); AddLabel( 25, 60 + (index * 20), 1152, ""+ amount ); AddLabel( 320, 60 + (index * 20), 1152, ""+ price ); AddButton( 100, 65 + (index * 20), 1209, 1210, i+2, GumpButtonType.Reply, 0 ); if ( ((VSItem)m_Stone.ItemList[i]).Description != null && ((VSItem)m_Stone.ItemList[i]).Description != "" ) AddButton( 135, 65 + (index * 20), 0x1523, 0x1523, i+m_Stone.ItemList.Count+3, GumpButtonType.Reply, 0 ); AddImageTiled( 10, 80 + (index * 20), 390, 3, 2624 ); index++; } }