From f5f93dd01e185cfca6ef2e8793e39529f38a6df5 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 10 Aug 2014 02:23:27 -0500 Subject: [PATCH] Change render for disabled image buttons when they are disabled. --- client/gui/widgets/GuiImgButton.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/client/gui/widgets/GuiImgButton.java b/client/gui/widgets/GuiImgButton.java index e383e00e..672e0749 100644 --- a/client/gui/widgets/GuiImgButton.java +++ b/client/gui/widgets/GuiImgButton.java @@ -201,7 +201,11 @@ public class GuiImgButton extends GuiButton implements ITooltip GL11.glTranslatef( this.xPosition, this.yPosition, 0.0F ); GL11.glScalef( 0.5f, 0.5f, 0.5f ); - GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); + if ( enabled ) + GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); + else + GL11.glColor4f( 0.5f, 0.5f, 0.5f, 1.0f ); + par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; @@ -217,7 +221,11 @@ public class GuiImgButton extends GuiButton implements ITooltip } else { - GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); + if ( enabled ) + GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); + else + GL11.glColor4f( 0.5f, 0.5f, 0.5f, 1.0f ); + par1Minecraft.renderEngine.bindTexture( ExtraBlockTextures.GuiTexture( "guis/states.png" ) ); this.field_146123_n = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; @@ -230,6 +238,7 @@ public class GuiImgButton extends GuiButton implements ITooltip this.mouseDragged( par1Minecraft, par2, par3 ); } } + GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f ); } private int getIconIndex()