It's the same code as I have posted above. I just used if loops after that batch of code to say what to put on which page. Here:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Network;
using Server.Spells;
using Server.Spells.Undine;
using Server.Prompts;
namespace Server.Gumps
{
public class SummonBookGump : Gump
{
private SummonBook m_Book;
public SummonBook Book{ get{ return m_Book; } }
private void AddBackground()
{
// Background image
AddImage( 100, 10, 2200, 0x89B );
// Two seperators
for ( int i = 0; i < 2; ++i )
{
int xOffset = 125 + (i * 165);
AddImage( xOffset, 50, 57, 0x168 );
xOffset += 20;
for ( int j = 0; j < 6; ++j, xOffset += 15 )
AddImage( xOffset, 50, 58 );
AddImage( xOffset - 5, 50, 59, 0x168 );
}
}
private void AddIndex()
{
AddButton( 393, 14, 2206, 2206, 0, GumpButtonType.Page, 2 );
}
public SummonBookGump( Mobile from, SummonBook book ) : base( 150, 200 )
{
m_Book = book;
AddIndex();
AddBackground();
for ( int page = 0; page < 4; ++page )
{
AddPage( 2 + page );
AddButton( 125, 14, 2205, 2205, 0, GumpButtonType.Page, 1 + page );
if ( page < 3 )
AddButton( 393, 14, 2206, 2206, 0, GumpButtonType.Page, 3 + page );
if ( page == 0 )
{
**your info for page 1**
}
if ( page == 1 )
{
**your info for page 2**
}
if ( page == 2 )
{
**your info for page 3**
}
if ( page == 3 )
{
**your info for page 4**
}
public static bool HasSpell( Mobile from, int spellID )
{
Spellbook book = Spellbook.Find( from, spellID );
return ( book != null && book.HasSpell( spellID ) );
}
public override void OnResponse( NetState state, RelayInfo info )
{
Mobile from = state.Mobile;
switch ( info.ButtonID )
{
case 0:
{
break;
}
case 1:
{
new FreezeSpell( from, null ).Cast();
break;
}
case 2:
{
new RestoreSpell( from, null ).Cast();
break;
}
case 3:
{
new IceswordSpell( from, null ).Cast();
break;
}
}
}
}
}
I'm kind of proud of myself for writing that because I don't know any c#
. The flipper as of now will repeat its cycle until you take out the code under AddIndex. But I need to get that first page gone before I can do that..I don't know why it creates a first page that I cannot place text on, but whatever. Enjoy!