aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuuxel <kasperi.kauppi@gmail.com>2019-07-27 22:24:52 +0300
committerJuuxel <kasperi.kauppi@gmail.com>2019-07-27 22:24:52 +0300
commitf4452bce5b7f3b96490a21e2c67f566e41ff99c2 (patch)
tree3eabc9669e7bebca8b0bcb92f8cb62a61b896bc6 /src
parentf0c8020eaab7fbb8839365fc7e579985d442c0db (diff)
downloadLibGui-f4452bce5b7f3b96490a21e2c67f566e41ff99c2.tar.gz
LibGui-f4452bce5b7f3b96490a21e2c67f566e41ff99c2.tar.bz2
LibGui-f4452bce5b7f3b96490a21e2c67f566e41ff99c2.zip
int_3 => state
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WButton.java8
1 files changed, 4 insertions, 4 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 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 && mouseX<x+getWidth() && mouseY<y+getHeight());
- int int_3 = 1; //1=regular. 2=hovered. 0=disabled.
- if (!active) int_3 = 0;
- else if (hovered) int_3 = 2;
+ int state = 1; //1=regular. 2=hovered. 0=disabled.
+ if (!active) state = 0;
+ else if (hovered) state = 2;
float px = 1/256f;
float buttonLeft = 0 * px;
- float buttonTop = (46 + (int_3*20)) * px;
+ float buttonTop = (46 + (state*20)) * px;
int halfWidth = getWidth()/2;
if (halfWidth>198) halfWidth=198;
float buttonWidth = halfWidth*px;