Skip to content

Commit

Permalink
Fix NEI item tooltip being drawn through popup panel (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
miozune authored Sep 30, 2024
1 parent ee6ca0d commit 47388e0
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) {
drawHandler.postRenderObjects(this, mouseX, mouseY);
}

if (!shouldRenderOurTooltip() && GuiContainerManager.getManager() != null) {
if (!shouldRenderOurTooltip() && shouldRenderNEITooltip() && GuiContainerManager.getManager() != null) {
GuiContainerManager.getManager().renderToolTips(mouseX, mouseY);
}
}
Expand Down Expand Up @@ -332,6 +332,13 @@ protected boolean shouldRenderOurTooltip() {
return context.getCursor().getHovered() != null;
}

protected boolean shouldRenderNEITooltip() {
Slot slot = GuiContainerManager.getSlotMouseOver(this);
// NEI will see slots through popup panel, so block them.
// Other than this case, any element in NEI can have tooltip.
return !(slot instanceof BaseSlot);
}

public void drawDebugScreen() {
Size screenSize = context.getScaledScreenSize();
int neiYOffset = shouldShowNEI() ? 20 : 0;
Expand Down

0 comments on commit 47388e0

Please sign in to comment.