Make ClickGui.kt an object

This commit is contained in:
Username404-59 2021-04-28 15:08:22 +02:00
parent 7fb904246e
commit d113c13ecc
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
2 changed files with 3 additions and 5 deletions

View File

@ -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<Element> = mutableSetOf(
ClickBox(4.0, 4.0, TranslatableComponent("snowy.clickbox.misc")),
ClickBox(90.0, 4.0, TranslatableComponent("snowy.clickbox.rendering"))

View File

@ -19,7 +19,7 @@ object AddKeyMaps {
) to lambda
}
val list: MutableMap<KeyMapping, (() -> 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()) }
)
}