Display tooltip for machine on controller

This commit is contained in:
Raoul Van den Berge
2016-03-24 18:56:14 +01:00
parent 06474a833d
commit 578e6da0a2
2 changed files with 7 additions and 1 deletions

View File

@@ -137,7 +137,7 @@ public abstract class GuiBase extends GuiContainer {
}
public void drawItem(int x, int y, ItemStack stack) {
drawItem(x, y, stack, false, null);
drawItem(x, y, stack, false);
}
public void drawItem(int x, int y, ItemStack stack, boolean withOverlay) {
@@ -185,7 +185,9 @@ public abstract class GuiBase extends GuiContainer {
}
public void drawTooltip(int x, int y, ItemStack stack) {
GL11.glDisable(GL11.GL_LIGHTING);
renderToolTip(stack, x, y);
GL11.glEnable(GL11.GL_LIGHTING);
}
public void drawTexture(int x, int y, int textureX, int textureY, int width, int height) {

View File

@@ -70,6 +70,10 @@ public class GuiController extends GuiBase {
ItemStack machineStack = new ItemStack(machineBlock, 1, machineBlock.getMetaFromState(machineState));
if (inBounds(x, y, 16, 16, mouseX, mouseY)) {
drawTooltip(mouseX, mouseY, machineStack);
}
drawItem(x, y, machineStack);
drawString(x + 21, y + 5, t("misc.refinedstorage:energy_usage_minimal", machine.getEnergyUsage()));
}