From 9513282d709b24c2ed31244acca1bb931befa413 Mon Sep 17 00:00:00 2001 From: MattMX <39436418+Matt-MX@users.noreply.github.com> Date: Tue, 14 May 2024 17:32:36 +0100 Subject: [PATCH] Update GuiHookExample.kt --- .../mattmx/ktgui/examples/GuiHookExample.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/plugin/src/main/kotlin/com/mattmx/ktgui/examples/GuiHookExample.kt b/plugin/src/main/kotlin/com/mattmx/ktgui/examples/GuiHookExample.kt index 43a9645..c8a07d1 100644 --- a/plugin/src/main/kotlin/com/mattmx/ktgui/examples/GuiHookExample.kt +++ b/plugin/src/main/kotlin/com/mattmx/ktgui/examples/GuiHookExample.kt @@ -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 + } } } }