aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <kasperi.kauppi@gmail.com>2019-07-28 09:25:02 +0300
committerJuuxel <kasperi.kauppi@gmail.com>2019-07-28 09:25:02 +0300
commitc560951ff9a6e44c9f95c489180c8599eaf560b5 (patch)
treefc7584a7687ffa0e9b615f264fc4accd39c061ca
parentf4452bce5b7f3b96490a21e2c67f566e41ff99c2 (diff)
downloadLibGui-c560951ff9a6e44c9f95c489180c8599eaf560b5.tar.gz
LibGui-c560951ff9a6e44c9f95c489180c8599eaf560b5.tar.bz2
LibGui-c560951ff9a6e44c9f95c489180c8599eaf560b5.zip
active => enabled
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java16
1 files changed, 8 insertions, 8 deletions
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<x+getWidth() && mouseY<y+getHeight());
int state = 1; //1=regular. 2=hovered. 0=disabled.
- if (!active) state = 0;
+ if (!enabled) state = 0;
else if (hovered) state = 2;
float px = 1/256f;
@@ -51,7 +51,7 @@ public class WButton extends WWidget {
if (label!=null) {
int color = 0xE0E0E0;
- if (!active) {
+ if (!enabled) {
color = 0xA0A0A0;
} else if (hovered) {
color = 0xFFFFA0;
@@ -69,7 +69,7 @@ public class WButton extends WWidget {
public void onClick(int x, int y, int button) {
super.onClick(x, y, button);
- if (active) {
+ if (enabled) {
MinecraftClient.getInstance().getSoundManager().play(PositionedSoundInstance.master(SoundEvents.UI_BUTTON_CLICK, 1.0F));
if (onClick!=null) onClick.run();
@@ -80,11 +80,11 @@ public class WButton extends WWidget {
this.onClick = r;
}
- public boolean isActive() {
- return active;
+ public boolean isEnabled() {
+ return enabled;
}
- public void setActive(boolean active) {
- this.active = active;
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
}
}