Fixed tooltips always being visible when a crafting monitor is disabled and there are task(s) running.

This commit is contained in:
raoulvdberge
2018-10-16 19:58:26 +02:00
parent db9d21bbe3
commit aec99b378d
3 changed files with 13 additions and 13 deletions

View File

@@ -255,9 +255,7 @@ public class GuiCraftingMonitor extends GuiBase {
drawTexture(x, y, 0, 0, screenWidth, screenHeight); drawTexture(x, y, 0, 0, screenWidth, screenHeight);
if (craftingMonitor.isActive()) { tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY, craftingMonitor.isActive());
tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY);
}
} }
@Override @Override

View File

@@ -55,19 +55,21 @@ public class TabList {
listeners.add(listener); listeners.add(listener);
} }
public void drawForeground(int x, int y, int mouseX, int mouseY) { public void drawForeground(int x, int y, int mouseX, int mouseY, boolean visible) {
this.tabHovering = -1; this.tabHovering = -1;
int j = 0; if (visible) {
for (int i = page.get() * tabsPerPage; i < (page.get() * tabsPerPage) + tabsPerPage; ++i) { int j = 0;
if (i < tabs.get().size()) { for (int i = page.get() * tabsPerPage; i < (page.get() * tabsPerPage) + tabsPerPage; ++i) {
drawTab(tabs.get().get(i), true, x, y, i, j); if (i < tabs.get().size()) {
drawTab(tabs.get().get(i), true, x, y, i, j);
if (gui.inBounds(x + getXOffset() + ((IGridTab.TAB_WIDTH + 1) * j), y, IGridTab.TAB_WIDTH, IGridTab.TAB_HEIGHT - (i == selected.get() ? 2 : 7), mouseX, mouseY)) { if (gui.inBounds(x + getXOffset() + ((IGridTab.TAB_WIDTH + 1) * j), y, IGridTab.TAB_WIDTH, IGridTab.TAB_HEIGHT - (i == selected.get() ? 2 : 7), mouseX, mouseY)) {
this.tabHovering = i; this.tabHovering = i;
}
j++;
} }
j++;
} }
} }
} }

View File

@@ -306,7 +306,7 @@ public class GuiGrid extends GuiBase implements IResizableDisplay {
drawTexture(x + 172, y + getTopHeight() + (getVisibleRows() * 18) + 22, 240, ty * 16, 16, 16); drawTexture(x + 172, y + getTopHeight() + (getVisibleRows() * 18) + 22, 240, ty * 16, 16, 16);
} }
tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY); tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY, true);
if (searchField != null) { if (searchField != null) {
searchField.drawTextBox(); searchField.drawTextBox();