diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt | 15 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt | 3 |
2 files changed, 10 insertions, 8 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 b26d88c4b..d893cef52 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/Renderable.kt @@ -151,7 +151,6 @@ 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() } @@ -232,6 +231,7 @@ interface Renderable { if (bypassChecks) { return isGuiScreen } + val inMenu = Minecraft.getMinecraft().currentScreen !is GuiIngameMenu val isGuiPositionEditor = Minecraft.getMinecraft().currentScreen !is GuiPositionEditor val isNotInSignAndOnSlot = if (Minecraft.getMinecraft().currentScreen !is GuiEditSign) { ToolTipData.lastSlot == null || GuiData.preDrawEventCanceled @@ -240,10 +240,11 @@ interface Renderable { val openGui = Minecraft.getMinecraft().currentScreen?.javaClass?.name ?: "none" val isInNeuPv = openGui == "io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer" + val neuFocus = NEUItems.neuHasFocus() val isInSkyTilsPv = openGui == "gg.skytils.skytilsmod.gui.profile.ProfileGui" - val result = isGuiScreen && isGuiPositionEditor && isNotInSignAndOnSlot && isConfigScreen && - !isInNeuPv && !isInSkyTilsPv + val result = isGuiScreen && isGuiPositionEditor && inMenu && isNotInSignAndOnSlot && isConfigScreen && + !isInNeuPv && !isInSkyTilsPv && !neuFocus if (debug) { if (!result) { @@ -251,9 +252,11 @@ interface Renderable { logger.log("blocked link because:") if (!isGuiScreen) logger.log("isGuiScreen") if (!isGuiPositionEditor) logger.log("isGuiPositionEditor") + if (!inMenu) logger.log("inMenu") if (!isNotInSignAndOnSlot) logger.log("isNotInSignAndOnSlot") if (!isConfigScreen) logger.log("isConfigScreen") if (isInNeuPv) logger.log("isInNeuPv") + if (neuFocus) logger.log("neuFocus") if (isInSkyTilsPv) logger.log("isInSkyTilsPv") logger.log("") } else { @@ -595,6 +598,7 @@ interface Renderable { scrollValue: ScrollValue = ScrollValue(), velocity: Double = 2.0, button: Int? = null, + bypassChecks: Boolean = false, horizontalAlign: HorizontalAlignment = HorizontalAlignment.LEFT, verticalAlign: VerticalAlignment = VerticalAlignment.TOP, ) = object : Renderable { @@ -617,7 +621,7 @@ interface Renderable { override fun render(posX: Int, posY: Int) { scroll.update( - isHovered(posX, posY) + isHovered(posX, posY) && shouldAllowLink(true, bypassChecks) ) var renderY = 0 @@ -651,6 +655,7 @@ interface Renderable { xPadding: Int = 1, yPadding: Int = 0, hasHeader: Boolean = false, + bypassChecks: Boolean = false, horizontalAlign: HorizontalAlignment = HorizontalAlignment.LEFT, verticalAlign: VerticalAlignment = VerticalAlignment.TOP, ) = object : Renderable { @@ -677,7 +682,7 @@ interface Renderable { override fun render(posX: Int, posY: Int) { scroll.update( - isHovered(posX, posY) + isHovered(posX, posY) && shouldAllowLink(true, bypassChecks) ) var renderY = 0 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 61149866b..14e4fde13 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/renderables/RenderableTooltips.kt @@ -2,12 +2,10 @@ 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 @@ -43,7 +41,6 @@ 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 |