mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 06:24:42 +00:00
Fix to Type Tab
This commit is contained in:
1 parent
0cbc30f8cb
commit
d3167df1b9
36 files changed
+648
-589
No files matched your search
@@ -97,6 +97,11 @@ public class GuiScrollWindow extends GuiScreen implements ITextfieldListener, IC
|
||||
}
|
||||
|
||||
public void mouseClicked(int i, int j, int k) {
|
||||
// Ignore clicks outside the visible scroll window area
|
||||
if (i < xPos || i > xPos + clipWidth || j < yPos || j > yPos + clipHeight) {
|
||||
return;
|
||||
}
|
||||
|
||||
i = i - xPos;
|
||||
j = (int) (j - yPos + scrollY);
|
||||
|
||||
@@ -246,6 +251,12 @@ public class GuiScrollWindow extends GuiScreen implements ITextfieldListener, IC
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
// Draw hover texts in screen space (after scissor/translation are undone)
|
||||
// so tooltips are not clipped and are positioned correctly
|
||||
if (isMouseOver(mouseX, mouseY)) {
|
||||
drawHoverTexts(mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
public void drawScreen(int mouseX, int mouseY, float partialTicks, int mouseScroll) {
|
||||
@@ -275,8 +286,18 @@ public class GuiScrollWindow extends GuiScreen implements ITextfieldListener, IC
|
||||
}
|
||||
for (GuiNpcButton button : buttons.values()) {
|
||||
button.updateSubGUI(subGui);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draws hover texts for buttons in screen space (called after GL scissor/translate are undone).
|
||||
* Hover state was already computed during drawComponents with scroll-local coords.
|
||||
*/
|
||||
private void drawHoverTexts(int mouseX, int mouseY) {
|
||||
boolean subGui = parent.hasSubGui();
|
||||
for (GuiNpcButton button : buttons.values()) {
|
||||
if (!button.hoverableText.isEmpty()) {
|
||||
button.drawHover(i, j, subGui);
|
||||
button.drawHover(mouseX, mouseY, subGui);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user