Fixed #1209 - "No tooltips for filtered fluids in Disk Drive GUI in fluid mode."

This commit is contained in:
raoulvdberge
2017-05-13 21:59:26 +02:00
parent 24855e2f35
commit 44a1dc515b
2 changed files with 11 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
- Fixed Crafting Tweaks buttons positioned wrongly (blay09)
- Fixed Crafting Tweaks keybindings interfering with RS keybindings (blay09)
- Fixed crash when updating storages (raoulvdberge)
- Fixed no tooltips for fluid filter slots (raoulvdberge)
- Removed ticking tile entities, every tile entity in RS is non-ticking now (raoulvdberge)
### 1.4.4

View File

@@ -54,6 +54,8 @@ public abstract class GuiBase extends GuiContainer {
private int lastButtonId;
private int lastSideButtonY;
private String hoveringFluid = null;
protected int screenWidth;
protected int screenHeight;
@@ -115,6 +117,8 @@ public abstract class GuiBase extends GuiContainer {
drawBackground(guiLeft, guiTop, mouseX, mouseY);
this.hoveringFluid = null;
for (int i = 0; i < inventorySlots.inventorySlots.size(); ++i) {
Slot slot = inventorySlots.inventorySlots.get(i);
@@ -123,6 +127,10 @@ public abstract class GuiBase extends GuiContainer {
if (stack != null) {
FLUID_RENDERER.draw(mc, guiLeft + slot.xPos, guiTop + slot.yPos, stack);
if (inBounds(guiLeft + slot.xPos, guiTop + slot.yPos, 18, 18, mouseX, mouseY)) {
this.hoveringFluid = stack.getLocalizedName();
}
}
}
}
@@ -151,8 +159,8 @@ public abstract class GuiBase extends GuiContainer {
drawForeground(mouseX, mouseY);
if (sideButtonTooltip != null) {
drawTooltip(mouseX, mouseY, sideButtonTooltip);
if (sideButtonTooltip != null || hoveringFluid != null) {
drawTooltip(mouseX, mouseY, sideButtonTooltip != null ? sideButtonTooltip : hoveringFluid);
}
}