previous/next pages in gump
Hi,
I have this gump which I want to add previous and next buttons too. I've tried everything I can think of but there is always something wrong with the method I choose.
Here is my method so far which comes from RunebookGump.cs:
The buttons show up but when they are pressed the gump just closes. I can't seem to work out what is wrong. Here is my gump so far:
Thanks for any help.
Plus
Hi,
I have this gump which I want to add previous and next buttons too. I've tried everything I can think of but there is always something wrong with the method I choose.
Here is my method so far which comes from RunebookGump.cs:
Code:
private void AddBackground()
{
AddImage(46, 27, 500);
for ( int page = 0; page < 8; ++page )
{
AddButton(46, 27, 501, 501, 0, GumpButtonType.Page, (1 + page) ); // previous page
if ( page < 7 )
AddButton(402, 27, 502, 502, 0, GumpButtonType.Page, (page + 3) ); //next page
}
}
The buttons show up but when they are pressed the gump just closes. I can't seem to work out what is wrong. Here is my gump so far:
Code:
using System;
using Server;
using Server.Gumps;
using Server.Items;
using System.Collections;
namespace Server.Gumps
{
public class MonsterbookGump : Gump
{
private Monsterbook m_Book;
public Monsterbook Book{ get{ return m_Book; } }
private void AddBackground()
{
AddImage(46, 27, 500);
for ( int page = 0; page < 8; ++page )
{
AddButton(46, 27, 501, 501, 0, GumpButtonType.Page, (1 + page) ); // previous page
if ( page < 7 )
AddButton(402, 27, 502, 502, 0, GumpButtonType.Page, (page + 3) ); //next page
}
}
public MonsterbookGump(Monsterbook book): base( 0, 0 )
{
m_Book = book;
this.Closable=true;
this.Disposable=true;
this.Dragable=true;
this.Resizable=false;
AddPage(1);
AddImage(46, 27, 500);
AddButton(402, 27, 502, 502, 0, GumpButtonType.Page, 2);
//AddBackground();
AddLabel(120, 44, 0, @"Monsters Killed");
AddLabel(103, 86, 0, @"Cows");
AddLabel(133, 86, 0, book.CowPoints.ToString());
AddLabel(103, 106, 0, @"Other");
AddPage(2);
AddBackground();
AddImage(261,12, 990);
AddImage(260, 13, 653);
AddPage(3);
AddBackground();
AddImage(46, 27, 500);
AddImage(251, 15, 50617);
AddImage(337, 25, 50647);
AddImage(252, 17, 13);
AddImage(251, 15, 60469);
AddImage(231, 0, 1882);
AddImage(230, 6, 1876);
}
}
}
Thanks for any help.
Plus