diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-05-21 01:39:34 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-20 17:39:34 +0200 |
commit | 846f16f372ce0c92969df2059bb72f2f4f339283 (patch) | |
tree | 9f90a9adbd7bdc8931d86169167b8c9af072b71a /src | |
parent | f0cd6514fb27b8c09441f1d4999e944822e3c205 (diff) | |
download | skyhanni-846f16f372ce0c92969df2059bb72f2f4f339283.tar.gz skyhanni-846f16f372ce0c92969df2059bb72f2f4f339283.tar.bz2 skyhanni-846f16f372ce0c92969df2059bb72f2f4f339283.zip |
Fix: Hover and clicks in guis (#1846)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt index 6c1e0bd2e..b26d88c4b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -26,6 +26,7 @@ import at.hannibal2.skyhanni.utils.renderables.RenderableUtils.renderYAligned import io.github.notenoughupdates.moulconfig.gui.GuiScreenElementWrapper import net.minecraft.client.Minecraft import net.minecraft.client.gui.Gui +import net.minecraft.client.gui.GuiIngameMenu import net.minecraft.client.gui.inventory.GuiEditSign import net.minecraft.client.renderer.GlStateManager import net.minecraft.item.ItemStack @@ -150,6 +151,7 @@ interface Renderable { override fun render(posX: Int, posY: Int) { if (isHovered(posX, posY) && condition() && shouldAllowLink(true, bypassChecks) && (button - 100).isKeyClicked() + && !NEUItems.neuHasFocus() && Minecraft.getMinecraft().currentScreen !is GuiIngameMenu ) { onClick() } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt b/src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt index 14e4fde13..61149866b 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt @@ -2,10 +2,12 @@ package at.hannibal2.skyhanni.utils.renderables import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.NEUItems import at.hannibal2.skyhanni.utils.RenderUtils import at.hannibal2.skyhanni.utils.renderables.RenderableUtils.renderXAligned import io.github.moulberry.notenoughupdates.util.Utils import net.minecraft.client.Minecraft +import net.minecraft.client.gui.GuiIngameMenu import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.renderer.RenderHelper @@ -41,6 +43,7 @@ object RenderableTooltips { val tooltip = tooltip ?: return val tips = tooltip.tips if (tips.isEmpty()) return + if (NEUItems.neuHasFocus() || Minecraft.getMinecraft().currentScreen is GuiIngameMenu) return val x = Utils.getMouseX() + 12 val y = Utils.getMouseY() - if (tips.size > 1) 2 else -7 |