From 846f16f372ce0c92969df2059bb72f2f4f339283 Mon Sep 17 00:00:00 2001 From: CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> Date: Tue, 21 May 2024 01:39:34 +1000 Subject: Fix: Hover and clicks in guis (#1846) --- src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt | 2 ++ .../java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt | 3 +++ 2 files changed, 5 insertions(+) (limited to 'src/main/java') 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 -- cgit