I didnt like the wiki buttons for pages so i decided to have a go at doing my own and im in need of some help bug bashing it will try to describe the problem in detail.
the page order is a little messed up right now.
the next and previous page scrolling just stops after a while and i cant work out why.
But i did give it a good go to rewrite the scroll buttons if any one can help me debug this and get it working would be great.
CODE
list buttons;
integer Choices;
integer PageNum;
integer page;
integer num_pages;
integer num_items;
dialog_buttons()
{
integer firstchoice;
integer lastchoice;
integer Choices;
integer MaxPage = 6;
list buttons_Bar;
Choices = llGetListLength(ColourName); // our taken data from notecard globally list at Colourname
if (Choices <=6)
{
buttons = Desc;
page = 0;
}
else
{
integer nPage = (Choices + MaxPage -1)/ MaxPage;
if (num_pages <1 || num_pages > nPage)
{
num_pages = 0;
}
firstchoice = (num_pages -1) * MaxPage;
lastchoice = firstchoice + MaxPage -1;
if (lastchoice >= Choices)
{
lastchoice = Choices;
}
}
if (num_pages == 1)
{
buttons_Bar = ["<< Prev", "<< Exit >>", "Next >>"];
}
else if (page == 0) buttons_Bar = ["<< Prev", "<< Exit >>", "Next >>"];
else if (page == num_pages-1)
{
buttons_Bar = ["<< Prev", "<< Exit >>", "Next >>"];
}
else buttons_Bar = ["<< Prev", "<< Exit >>", "Next >>"];
buttons = buttons_Bar + llList2List(ColourName,firstchoice, lastchoice);
}
What i did was take the wiki's section on putting the names onto buttons and another example that i had to change the buttons over and i think i made a right mess of it.
below is the tail end of the data server that catchs the info to put onto the buttons
CODE
// Snipped lines
else
{
num_items = llGetListLength(Desc);
num_pages = num_items / 6;
if ((num_items - (num_pages * 6))>0) num_pages++;
}
// Snipped Lines
And below this is the listen catching the buttons when its clicked to scroll
CODE
//Snipped lines
else if (message == "<< Prev")
{
num_pages--;
dialog_buttons();
}
else if (message == "Next >>")
{
num_pages++;
dialog_buttons();
}
// Snipped Lines
I snipped off lines here not because i didnt want to post the whole code but its just a data server and that is working fine for routing the information out i need.
In this case it was just a seperated name and vector from notecard.
Ok will try to explain about the segments.
What i did was use try to add my own previous and next buttons so the pages would constant loop with the different data on that was read.
The wiki was a base plate as i didnt like the way the buttons on that scrolled at all stuck with a page number on and all and i wanted something i could say i done that bit to make it work as i had intended.
If any one can help me fix this mess i made the rest of the script is fine without no bugs or problems its just i made a moppy mess of the buttons

pretty much what i wanted was the data dug from my dataserver printed onto the buttons with a working next and previous page scroll
