diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-24 22:36:45 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-03-24 22:36:45 +0100 |
commit | 2bcde66ce1c01ea6da785e422c46c6f178ca10c2 (patch) | |
tree | 9c075904325ce6243b6f4ef7454cac2975b1e3b0 /src/main/java | |
parent | a5bb62a327a2b1a69a952caa6a5e089b23c1af38 (diff) | |
download | skyhanni-2bcde66ce1c01ea6da785e422c46c6f178ca10c2.tar.gz skyhanni-2bcde66ce1c01ea6da785e422c46c6f178ca10c2.tar.bz2 skyhanni-2bcde66ce1c01ea6da785e422c46c6f178ca10c2.zip |
Code cleanup
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt | 36 |
1 files changed, 24 insertions, 12 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 4e608ee3b..44672ff46 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 @@ -101,20 +101,32 @@ class GuiPositionEditor( val elementHeight = position.getDummySize().y drawRect(x - border, y - border, x + elementWidth + border * 2, y + elementHeight + border * 2, -0x7fbfbfc0) - if (hoveredPos != -1) { - val pos = positions[hoveredPos] - Utils.drawStringCentered( - "§b" + pos.internalName, Minecraft.getMinecraft().fontRendererObj, - (scaledResolution.scaledWidth / 2).toFloat(), 18f, true, 0xffffff - ) - val location = "§7x: §e${pos.rawX}§7, y: §e${pos.rawY}" - Utils.drawStringCentered( - location, Minecraft.getMinecraft().fontRendererObj, - (scaledResolution.scaledWidth / 2).toFloat(), 28f, true, 0xffffff - ) - } } + GlStateManager.popMatrix() + + var displayPos = -1 + if (clickedPos != -1) { + if (positions[clickedPos].clicked) { + displayPos = clickedPos + } + } + if (displayPos == -1) { + displayPos = hoveredPos + } + + if (displayPos != -1) { + val pos = positions[displayPos] + Utils.drawStringCentered( + "§b" + pos.internalName, Minecraft.getMinecraft().fontRendererObj, + (scaledResolution.scaledWidth / 2).toFloat(), 18f, true, 0xffffff + ) + val location = "§7x: §e${pos.rawX}§7, y: §e${pos.rawY}" + Utils.drawStringCentered( + location, Minecraft.getMinecraft().fontRendererObj, + (scaledResolution.scaledWidth / 2).toFloat(), 28f, true, 0xffffff + ) + } } @Throws(IOException::class) |