From f2bc0a38b186c1ec658009cc68f910bbd82ca517 Mon Sep 17 00:00:00 2001 From: Bernhard Bonigl Date: Mon, 21 Dec 2015 17:06:34 +0100 Subject: [PATCH] Convenience functions for slider and draw disabled button if disabled but shown --- .../mantle/client/gui/GuiWidgetSlider.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/slimeknights/mantle/client/gui/GuiWidgetSlider.java b/src/main/java/slimeknights/mantle/client/gui/GuiWidgetSlider.java index c0940ba1..316fcd8a 100644 --- a/src/main/java/slimeknights/mantle/client/gui/GuiWidgetSlider.java +++ b/src/main/java/slimeknights/mantle/client/gui/GuiWidgetSlider.java @@ -78,6 +78,10 @@ public int getValue() { return currentValue; } + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + public void enable() { this.enabled = true; } @@ -90,6 +94,10 @@ public boolean isEnabled() { return this.enabled; } + public void setHidden(boolean hidden) { + this.hidden = hidden; + } + public void hide() { this.hidden = true; } @@ -127,6 +135,9 @@ else if(isHighlighted) { slider.draw(x, y); } } + else { + sliderDisabled.draw(x, y); + } } public void update(int mouseX, int mouseY, boolean useMouseWheel) {