diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-08-11 15:29:51 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-08-11 15:29:51 +0200 |
commit | 74a805103ba3fba9e43af21071165b0a2232a0ab (patch) | |
tree | 3a50e3eb585874c6e70be6e57847f27040145719 /src/main | |
parent | 8f99611e9504af4398bd6ed961804c7d8668962d (diff) | |
download | skyhanni-74a805103ba3fba9e43af21071165b0a2232a0ab.tar.gz skyhanni-74a805103ba3fba9e43af21071165b0a2232a0ab.tar.bz2 skyhanni-74a805103ba3fba9e43af21071165b0a2232a0ab.zip |
reverting GuiPositionEditor changes from preprocessor pr
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt index 817defc5f..db6ca3c30 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt +++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt @@ -28,8 +28,6 @@ import at.hannibal2.skyhanni.mixins.transformers.gui.AccessorGuiContainer import at.hannibal2.skyhanni.utils.GuiRenderUtils import at.hannibal2.skyhanni.utils.KeyboardManager import at.hannibal2.skyhanni.utils.LorenzUtils.round -import at.hannibal2.skyhanni.utils.compat.GuiScreenUtils -import at.hannibal2.skyhanni.utils.compat.SkyhanniBaseScreen import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen import net.minecraft.client.gui.ScaledResolution @@ -43,7 +41,7 @@ class GuiPositionEditor( private val positions: List<Position>, private val border: Int, private val oldScreen: GuiContainer? = null, -) : SkyhanniBaseScreen() { +) : GuiScreen() { private var grabbedX = 0 private var grabbedY = 0 @@ -149,15 +147,15 @@ class GuiPositionEditor( return hoveredPos } - private fun getScaledHeight() = GuiScreenUtils.scaledWindowHeight - private fun getScaledWidth() = GuiScreenUtils.scaledWindowHeight + private fun getScaledHeight() = ScaledResolution(Minecraft.getMinecraft()).scaledHeight + private fun getScaledWidth() = ScaledResolution(Minecraft.getMinecraft()).scaledWidth @Throws(IOException::class) override fun mouseClicked(originalX: Int, priginalY: Int, mouseButton: Int) { super.mouseClicked(originalX, priginalY, mouseButton) - val mouseX = GuiScreenUtils.mouseX - val mouseY = GuiScreenUtils.mouseY + val mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth + val mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1 for (i in positions.indices.reversed()) { val position = positions[i] val elementWidth = position.getDummySize().x |