Skip to content

Commit f405368

Browse files
authored
Merge pull request #288 from pylonmc/task/shift-click-homepage
Shift clicking on back sends to homepage
2 parents b761580 + 321eba2 commit f405368

File tree

1 file changed

+5
-1
lines changed
  • pylon-core/src/main/kotlin/io/github/pylonmc/pylon/core/guide/button

1 file changed

+5
-1
lines changed

pylon-core/src/main/kotlin/io/github/pylonmc/pylon/core/guide/button/BackButton.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ open class BackButton(val player: Player) : AbstractItem() {
1717

1818
override fun handleClick(clickType: ClickType, player: Player, event: InventoryClickEvent) {
1919
val history = PylonGuide.history.getOrPut(player.uniqueId) { mutableListOf() }
20-
if (history.size >= 2) {
20+
21+
if (clickType.isShiftClick) {
22+
history.clear()
23+
PylonGuide.rootPage.open(player);
24+
} else if (history.size >= 2) {
2125
history.removeLast() // remove the current page
2226
history.removeLast().open(player)
2327
}

0 commit comments

Comments
 (0)