From 3ddb1ff16d6073392f2d5891cd51099a8bc9b097 Mon Sep 17 00:00:00 2001 From: noil755 Date: Mon, 2 Dec 2019 19:42:16 -0500 Subject: [PATCH] added translation method for tooltip, moved up a bit --- .../gui/hud/component/module/ModuleListComponent.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java index a80d4ec..a4adb4d 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java +++ b/src/main/java/me/rigamortis/seppuku/impl/gui/hud/component/module/ModuleListComponent.java @@ -8,6 +8,7 @@ import me.rigamortis.seppuku.impl.gui.hud.GuiHudEditor; import me.rigamortis.seppuku.impl.module.ui.HudEditorModule; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.renderer.GlStateManager; import org.apache.commons.lang3.StringUtils; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -93,12 +94,15 @@ public final class ModuleListComponent extends DraggableHudComponent { if (!insideTitlebar && insideComponent) { final int tooltipWidth = mc.fontRenderer.getStringWidth(module.getDesc()); final int tooltipHeight = mc.fontRenderer.FONT_HEIGHT; + + GlStateManager.translate(mouseX - tooltipWidth / 2, mouseY - tooltipHeight, 0); // Tooltip background - RenderUtil.drawRect(mouseX - tooltipWidth / 2 - 2, mouseY - tooltipHeight - 2, mouseX + tooltipWidth / 2 + 2, mouseY + 2, 0x99101010); - RenderUtil.drawRect(mouseX - tooltipWidth / 2 - 1, mouseY - tooltipHeight - 1, mouseX + tooltipWidth / 2 + 1, mouseY + 1, 0xFF101010); + RenderUtil.drawRect(-2, -6, tooltipWidth + 2, 5, 0x80101010); + RenderUtil.drawRect(-1, -5, tooltipWidth + 1, 4, 0xAD101010); // Tooltip - mc.fontRenderer.drawStringWithShadow(module.getDesc(), mouseX - tooltipWidth / 2, mouseY - tooltipHeight, 0xFFC255FF); + mc.fontRenderer.drawStringWithShadow(module.getDesc(), 0, -5, 0xADC255FF); + GlStateManager.translate(-(mouseX - tooltipWidth / 2), -(mouseY - tooltipHeight), 0); } height += Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT + TEXT_GAP; }