Added setEnabled() method to GuiElement interface and implemented it everywhere

Made GuiFileChooser a child of GuiAdvancedButton instead of GuiButton
This commit is contained in:
CrushedPixel
2015-07-07 16:55:37 +02:00
parent 392db29b34
commit 1b189c0dac
13 changed files with 69 additions and 4 deletions

View File

@@ -10,6 +10,7 @@ public class GuiString extends Gui implements GuiElement {
public int positionX, positionY;
public Color color;
public Callable<String> getContent;
private boolean enabled = true;
public GuiString(int positionX, int positionY, Color color, final String content) {
this(positionX, positionY, color, new Callable<String>() {
@@ -35,7 +36,7 @@ public class GuiString extends Gui implements GuiElement {
} catch (Exception e) {
throw new RuntimeException(e);
}
drawString(mc.fontRendererObj, text, positionX, positionY, color.getRGB());
drawString(mc.fontRendererObj, text, positionX, positionY, enabled ? color.getRGB() : Color.LIGHT_GRAY.getRGB());
}
@Override
@@ -72,4 +73,9 @@ public class GuiString extends Gui implements GuiElement {
public void tick(Minecraft mc) {
}
@Override
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}