From 905d95031aa9dab11caa5775a2d1e31b3febd2c0 Mon Sep 17 00:00:00 2001 From: Bella Date: Thu, 16 Apr 2020 13:55:41 -0400 Subject: [PATCH] fix the dumb fricking gui bug --- .../kami/gui/kami/theme/kami/RootCheckButtonUI.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java index 6f31fced..82767933 100644 --- a/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java +++ b/src/main/java/me/zeroeightsix/kami/gui/kami/theme/kami/RootCheckButtonUI.java @@ -1,10 +1,11 @@ package me.zeroeightsix.kami.gui.kami.theme.kami; import me.zeroeightsix.kami.KamiMod; -import me.zeroeightsix.kami.command.Command; +import me.zeroeightsix.kami.gui.kami.DisplayGuiScreen; import me.zeroeightsix.kami.gui.kami.KamiGUI; import me.zeroeightsix.kami.gui.kami.RenderHelper; import me.zeroeightsix.kami.gui.kami.component.SettingsPanel; +import me.zeroeightsix.kami.gui.rgui.component.Component; import me.zeroeightsix.kami.gui.rgui.component.container.Container; import me.zeroeightsix.kami.gui.rgui.component.use.CheckButton; import me.zeroeightsix.kami.gui.rgui.render.AbstractComponentUI; @@ -44,10 +45,13 @@ public class RootCheckButtonUI extends AbstractComponentU if (component.isHovered()) { c = (c & GuiC.buttonHoveredN.color.getRGB()) << 1; // hovered text color if (component.hasDescription() && !isSettingsOpen()) { + Component componentAt = KamiMod.getInstance().guiManager.getComponentAt(DisplayGuiScreen.mouseX, DisplayGuiScreen.mouseY); + if (componentAt.getHeight() != 11) return; // PREVENT DRAWING WHEN OUTSIDE THE CONTAINER // 11 is height of the regular module + glDisable(GL_SCISSOR_TEST); // let it draw outside of the container glDepthRange(0, 0.01); // set render priority to the top - int tooltipX = 14; + int tooltipX = 14; // padding int tooltipWidth = KamiGUI.fontRenderer.getStringWidth(component.getDescription() + 2); boolean tooBig = Wrapper.getMinecraft().displayWidth < (Mouse.getX() + (tooltipWidth * 2 + (component.getWidth() * 2)));