From 6745ea8ff3cb3d10018b95e4e99f56c77ca834a5 Mon Sep 17 00:00:00 2001 From: raoulvdberge Date: Sat, 2 Sep 2017 14:21:11 +0200 Subject: [PATCH] Fixed crash with GUI when toggling the Grid size quickly, fixes #1440 --- CHANGELOG.md | 1 + .../java/com/raoulvdberge/refinedstorage/gui/GuiBase.java | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adabcba2a..250fe18fe 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Fixed network not disconnecting when Controller is broken (raoulvdberge) - Fixed bug where when multiple Fortune Upgrades are inserted, it chooses the first Fortune Upgrade instead of the highest one (raoulvdberge) - Fixed some translations having too big "Craft" text (raoulvdberge) +- Fixed crash with GUI when toggling the Grid size quickly (raoulvdberge) - The Fortune Upgrade doesn't use NBT anymore to store the fortune level (raoulvdberge) - Pressing SHIFT over an item in the Grid will no longer display the full unformatted count, instead, use CTRL + SHIFT and it will be displayed in the tooltip (raoulvdberge) diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiBase.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiBase.java index 238cb05be..566ac6bbc 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiBase.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiBase.java @@ -162,7 +162,9 @@ public abstract class GuiBase extends GuiContainer { String sideButtonTooltip = null; - for (GuiButton button : buttonList) { + for (int i = 0; i < buttonList.size(); ++i) { + GuiButton button = buttonList.get(i); + if (button instanceof SideButton && ((SideButton) button).isHovered()) { sideButtonTooltip = ((SideButton) button).getTooltip(); } @@ -327,10 +329,6 @@ public abstract class GuiBase extends GuiContainer { GlStateManager.enableLighting(); } - public void drawTooltip(int x, int y, List lines) { - drawTooltip(ItemStack.EMPTY, x, y, lines); - } - public void drawTexture(int x, int y, int textureX, int textureY, int width, int height) { drawTexturedModalRect(x, y, textureX, textureY, width, height); }