Skip to content

Commit

Permalink
fix: page change behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Nov 14, 2024
1 parent 9c9e9f6 commit c5dc6d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ kotlin_version=2.0.21
fabric_kotlin_version=1.12.3

# mod properties
mod_version=1.9.1
mod_version=1.9.2
maven_group=net.mcbrawls
mod_id=slate
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ abstract class PagedSlateLayer(

callbacks {
onClick { slate, tile, context ->
callback?.onClick(slate, tile, context)
currentPage = modifier.invoke(currentPage)
updateTileGrid()
callback?.onClick(slate, tile, context)
}
}
}
}

fun createNextPageTile(stack: ItemStack, callback: TileClickCallback? = null): Tile {
return createPageChangeTile("Next Page", Int::unaryPlus, stack, callback)
return createPageChangeTile("Next Page", { it + 1 }, stack, callback)
}

fun createPreviousPageTile(stack: ItemStack, callback: TileClickCallback? = null): Tile {
return createPageChangeTile("Previous Page", Int::unaryMinus, stack, callback)
return createPageChangeTile("Previous Page", { it - 1 }, stack, callback)
}

companion object {
Expand Down

0 comments on commit c5dc6d8

Please sign in to comment.