Hello, i am creating a Gump, it has 2 sides both of which can overflow into pages, i have everything lined up, all graphics/buttons in the right place, the pages work singly.

I mean to say, if i write out the left side the next page/prev page work fine, if i do not write out the left side but write out the right, the pages work fine.

When i write out the left side and right side then the page buttons try to move both sides, i am sure it is probably just a small thing, but being as this is my first time doing something like this with ServUO i am not sure what it is.

Any help at all would be appreciated.
 
Allow me to elaborate a bit on this, the issue i am having is with 2 separate sides changing pages when the opposite side is clicked.

First i create the left side categories.
Code:
  void CreateCategoryList()
        {
            int categoriesPerPage = 5;
            for (int i = 0; i < _questList.Count; i++)
            {
                int catIndex = i % categoriesPerPage;
              
                AdvancedQuestCategory c = _questList[i];

                if (catIndex == 0)
                {
                    if (i > 0)
                    {
                        AddButton(310, 515, 4005, 4006, 0, GumpButtonType.Page, (i / categoriesPerPage) + 1); // Next Page
                        AddTooltip(1011066);
                    }

                    AddPage((i / categoriesPerPage) + 1);

                    if (i > 0)
                    {
                        AddButton(160, 515, 4014, 4015, 0, GumpButtonType.Page, i / categoriesPerPage); // Prev Page
                        AddTooltip(1011067);
                    }
                }
                // Add the actual category box
                AddBackground(168, 165 + (catIndex * 70), 175, 65, 311); // background

                AddLabel(205, 187 + (catIndex * 70), 0, c.CategoryName);
                AddButton(185, 190 + (catIndex * 70), 2117, 2118, GetButtonID(0, i), GumpButtonType.Reply, 0);
                // Build the button to display quests in this category on right
                // Place the category Name on same line as button Hue 0x480

           
            }
        }

If this is all i do it works fine, then i create the right side

Code:
    void GenerateItemsList()
        {
            int questItemsPerPage = 4;

            for (int i = 0; i < _questList.Count; i++)
            {
                AdvancedQuestCategory c = _questList[i];

                // Now add the quests per category
                for (int j = 0; j < c.Count; j++)
                {
                    int itemsIndex = j % questItemsPerPage;
                    AdvancedQuestItem item = c[j];

                    if (itemsIndex == 0)
                    {
                        if (j > 0)
                        {
                            AddButton(655, 515, 4005, 4007, 0, GumpButtonType.Page, (j / questItemsPerPage) + 1); // Next Page
                        }

                        AddPage((j / questItemsPerPage) + 1);

                        if (j > 0)
                        {
                            AddButton(355, 515, 4014, 4014, 0, GumpButtonType.Page, j / questItemsPerPage); // Prev Page
                        }
                    }
                    AddBackground(355, 175 + (itemsIndex * 85), 326, 85, 311);
                    AddLabel(380, 190 + (itemsIndex * 70), 0, item._questTitle);
                }
            }
        }

Once i run both of these functions back to back then any next page or prev page button tries to work both sides at once, what am i missing ?
[doublepost=1484198462][/doublepost]
Allow me to elaborate a bit on this, the issue i am having is with 2 separate sides changing pages when the opposite side is clicked.

First i create the left side categories.
Code:
  void CreateCategoryList()
        {
            int categoriesPerPage = 5;
            for (int i = 0; i < _questList.Count; i++)
            {
                int catIndex = i % categoriesPerPage;
             
                AdvancedQuestCategory c = _questList[i];

                if (catIndex == 0)
                {
                    if (i > 0)
                    {
                        AddButton(310, 515, 4005, 4006, 0, GumpButtonType.Page, (i / categoriesPerPage) + 1); // Next Page
                        AddTooltip(1011066);
                    }

                    AddPage((i / categoriesPerPage) + 1);

                    if (i > 0)
                    {
                        AddButton(160, 515, 4014, 4015, 0, GumpButtonType.Page, i / categoriesPerPage); // Prev Page
                        AddTooltip(1011067);
                    }
                }
                // Add the actual category box
                AddBackground(168, 165 + (catIndex * 70), 175, 65, 311); // background

                AddLabel(205, 187 + (catIndex * 70), 0, c.CategoryName);
                AddButton(185, 190 + (catIndex * 70), 2117, 2118, GetButtonID(0, i), GumpButtonType.Reply, 0);
                // Build the button to display quests in this category on right
                // Place the category Name on same line as button Hue 0x480

          
            }
        }

If this is all i do it works fine, then i create the right side

Code:
    void GenerateItemsList()
        {
            int questItemsPerPage = 4;

            for (int i = 0; i < _questList.Count; i++)
            {
                AdvancedQuestCategory c = _questList[i];

                // Now add the quests per category
                for (int j = 0; j < c.Count; j++)
                {
                    int itemsIndex = j % questItemsPerPage;
                    AdvancedQuestItem item = c[j];

                    if (itemsIndex == 0)
                    {
                        if (j > 0)
                        {
                            AddButton(655, 515, 4005, 4007, 0, GumpButtonType.Page, 200 + j); // Next Page
                        }

                        AddPage((j / questItemsPerPage) + 1);

                        if (j > 0)
                        {
                            AddButton(355, 515, 4014, 4014, 0, GumpButtonType.Page, 300 + j); // Prev Page
                        }
                    }
                    AddBackground(355, 175 + (itemsIndex * 85), 326, 85, 311);
                    AddLabel(380, 190 + (itemsIndex * 70), 0, item._questTitle);
                }
            }
        }

Once i run both of these functions back to back then any next page or prev page button tries to work both sides at once, what am i missing ?


Well after i posted it i realized the issue is probably the nested loop in GenerateItems
[doublepost=1484236149][/doublepost]I really could use help on this, any help, it makes no sense to me why its doing this, and i am stuck on the new system until i figure this out
 
Last edited:
I'm guessing next or previous are affecting both sides because both pages are created/called within the same gump. You might have to create some custom page flippers for each side of the gump that only advance or return on the specific side you want.
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back