From d113c13eccbdcde1cf88294ba6e88473a316feb9 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Wed, 28 Apr 2021 15:08:22 +0200 Subject: [PATCH] Make ClickGui.kt an object --- common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt | 6 ++---- .../main/kotlin/fr/username404/snowygui/misc/AddKeyMaps.kt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt b/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt index 644fedd..304eb94 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt @@ -5,10 +5,8 @@ import fr.username404.snowygui.gui.Element import fr.username404.snowygui.gui.SnowyScreen import net.minecraft.network.chat.TranslatableComponent -class ClickGui: SnowyScreen() { - private companion object { - var GuiDragging: Boolean = false - } +object ClickGui: SnowyScreen() { + private var GuiDragging: Boolean = false override val components: MutableSet = mutableSetOf( ClickBox(4.0, 4.0, TranslatableComponent("snowy.clickbox.misc")), ClickBox(90.0, 4.0, TranslatableComponent("snowy.clickbox.rendering")) diff --git a/common/src/main/kotlin/fr/username404/snowygui/misc/AddKeyMaps.kt b/common/src/main/kotlin/fr/username404/snowygui/misc/AddKeyMaps.kt index f65f38d..a215765 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/misc/AddKeyMaps.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/misc/AddKeyMaps.kt @@ -19,7 +19,7 @@ object AddKeyMaps { ) to lambda } val list: MutableMap Unit)?> = mutableMapOf( - mkMap("opengui", GLFW_KEY_Y) { Minecraft.getInstance().setScreen(ClickGui()) }, + mkMap("opengui", GLFW_KEY_Y) { Minecraft.getInstance().setScreen(ClickGui) }, mkMap("configkey", GLFW_KEY_U) { Minecraft.getInstance().setScreen(SnowyConfigScreen()) } ) } \ No newline at end of file