Skip to content

Commit 47388e0

Browse files
authored
Fix NEI item tooltip being drawn through popup panel (#82)
1 parent ee6ca0d commit 47388e0

File tree

1 file changed

+8
-1
lines changed
  • src/main/java/com/gtnewhorizons/modularui/common/internal/wrapper

1 file changed

+8
-1
lines changed

src/main/java/com/gtnewhorizons/modularui/common/internal/wrapper/ModularGui.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
147147
drawHandler.postRenderObjects(this, mouseX, mouseY);
148148
}
149149

150-
if (!shouldRenderOurTooltip() && GuiContainerManager.getManager() != null) {
150+
if (!shouldRenderOurTooltip() && shouldRenderNEITooltip() && GuiContainerManager.getManager() != null) {
151151
GuiContainerManager.getManager().renderToolTips(mouseX, mouseY);
152152
}
153153
}
@@ -332,6 +332,13 @@ protected boolean shouldRenderOurTooltip() {
332332
return context.getCursor().getHovered() != null;
333333
}
334334

335+
protected boolean shouldRenderNEITooltip() {
336+
Slot slot = GuiContainerManager.getSlotMouseOver(this);
337+
// NEI will see slots through popup panel, so block them.
338+
// Other than this case, any element in NEI can have tooltip.
339+
return !(slot instanceof BaseSlot);
340+
}
341+
335342
public void drawDebugScreen() {
336343
Size screenSize = context.getScaledScreenSize();
337344
int neiYOffset = shouldShowNEI() ? 20 : 0;

0 commit comments

Comments
 (0)