Skip to content

Commit

Permalink
Update GuiHookExample.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-MX authored May 14, 2024
1 parent 45c9968 commit 9513282
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions plugin/src/main/kotlin/com/mattmx/ktgui/examples/GuiHookExample.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,24 @@ class GuiHookExample : Example {
if ((gui as GuiScreen).id != "kgui.example.gui-hook") return@event

var signalExampleVar by (gui as GuiScreen).signal(0)
gui.button(Material.PURPLE_DYE) {
named(!"&d&lA button")
lore {
add(!"&fThis button was added after the gui was built.")
add(!"&fWe can even add our own signals here and whatnot: $signalExampleVar")
add(!"&a&l[CLICK]")
}
click {
ClickType.LEFT {
signalExampleVar++
gui.effect {
button(Material.PURPLE_DYE) {
named(!"&d&lA button")
lore {
add(!"&fThis button was added after the gui was built.")
add(!"&fWe can even add our own signals here and whatnot: $signalExampleVar")
add(!"&a&l[CLICK]")
}
ClickType.RIGHT {
signalExampleVar--
click {
ClickType.LEFT {
signalExampleVar++
}
ClickType.RIGHT {
signalExampleVar--
}
}
}
} slot 15
} slot 15
}
}
}
}
Expand Down

0 comments on commit 9513282

Please sign in to comment.