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);
if (craftingMonitor.isActive()) {
tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY);
}
tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY, craftingMonitor.isActive());
}
@Override

View File

@@ -55,9 +55,10 @@ public class TabList {
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;
if (visible) {
int j = 0;
for (int i = page.get() * tabsPerPage; i < (page.get() * tabsPerPage) + tabsPerPage; ++i) {
if (i < tabs.get().size()) {
@@ -71,6 +72,7 @@ public class TabList {
}
}
}
}
public void update() {
boolean hasTabs = !tabs.get().isEmpty();

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);
}
tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY);
tabs.drawForeground(x, y - tabs.getHeight(), mouseX, mouseY, true);
if (searchField != null) {
searchField.drawTextBox();