From be7deb39168e3002fc647fb18e231fd6a5a9d80a Mon Sep 17 00:00:00 2001 From: Username404 Date: Sun, 18 Jul 2021 11:59:19 +0200 Subject: [PATCH] Fix the Y position of keystrokes --- .../kotlin/fr/username404/snowygui/gui/feature/Keystrokes.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Keystrokes.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Keystrokes.kt index 80a3b98..349f255 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Keystrokes.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/Keystrokes.kt @@ -9,7 +9,10 @@ import net.minecraft.client.Minecraft @ButtonInfo(Category.HUD) object Keystrokes: ButtonImplWithHud() { - private val hud = object : ColoredElement(x = 135.0, y = 325.0, height = 36, width = 36, color = Colors.BLACK(), opacity = 0.5F) { + private val hud = object : ColoredElement(x = 135.0, y = 20.0, height = 36, width = 36, color = Colors.BLACK(), opacity = 0.5F) { + override var y: Double + get() = Minecraft.getInstance().window.guiScaledHeight.toDouble() - yOrigin + set(value) = Unit private val keysArray by lazy { Minecraft.getInstance().options.run { arrayOf(keyLeft, keyDown, keyRight, keyUp) to arrayOf(0.5, 0.5, 0.5, 0.5)