From f0c8020eaab7fbb8839365fc7e579985d442c0db Mon Sep 17 00:00:00 2001 From: Juuxel Date: Sat, 27 Jul 2019 22:18:22 +0300 Subject: Add support for disabling buttons --- .../github/cottonmc/cotton/gui/widget/WButton.java | 27 +++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java index bfae32f..532dffb 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java @@ -11,6 +11,7 @@ public class WButton extends WWidget { private Text label; protected int color = WLabel.DEFAULT_TEXT_COLOR; protected int darkmodeColor = WLabel.DEFAULT_TEXT_COLOR; + private boolean active = true; private Runnable onClick; @@ -32,7 +33,8 @@ public class WButton extends WWidget { public void paintForeground(int x, int y, int mouseX, int mouseY) { boolean hovered = (mouseX>=x && mouseY>=y && mouseX