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') 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 Date: Sat, 27 Jul 2019 22:24:52 +0300 Subject: int_3 => state --- src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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 532dffb..876da0c 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 @@ -32,13 +32,13 @@ public class WButton extends WWidget { @Override public void paintForeground(int x, int y, int mouseX, int mouseY) { boolean hovered = (mouseX>=x && mouseY>=y && mouseX198) halfWidth=198; float buttonWidth = halfWidth*px; -- cgit From c560951ff9a6e44c9f95c489180c8599eaf560b5 Mon Sep 17 00:00:00 2001 From: Juuxel Date: Sun, 28 Jul 2019 09:25:02 +0300 Subject: active => enabled --- .../io/github/cottonmc/cotton/gui/widget/WButton.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src') 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 876da0c..3b6c299 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,7 +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 boolean enabled = true; private Runnable onClick; @@ -33,7 +33,7 @@ public class WButton extends WWidget { public void paintForeground(int x, int y, int mouseX, int mouseY) { boolean hovered = (mouseX>=x && mouseY>=y && mouseX