Skip to content

Commit

Permalink
fix: pagination issue
Browse files Browse the repository at this point in the history
  • Loading branch information
LupusVirtute committed Jan 5, 2023
1 parent 965bafc commit 36d7e94
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/spacemc/utils/gui/PaginatedGUI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ abstract class PaginatedGUI {

val forwardPane = StaticPane(6, 4, 3, 2)
forwardPane.fillWith(forwardItem) {
if (paginatedPane.pages < paginatedPane.page)
if(paginatedPane.pages-1 > paginatedPane.page)
paginatedPane.page++
gui.update()
}

val backPane = StaticPane(0, 4, 3, 2)
backPane.fillWith(backItem) {
if (paginatedPane.page > 0)
if(paginatedPane.pages-1 > paginatedPane.page)
paginatedPane.page--
gui.update()
}

val closePane = StaticPane(3, 4, 3, 2)
Expand Down

0 comments on commit 36d7e94

Please sign in to comment.