aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-23 22:58:36 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-23 22:58:36 +0900
commit0593c1b6390ddf7c92c6a5ddab3e31c5f6e59e7d (patch)
treec8b4715deb01f397abb8c9b5564b2d9bfd6dffd9 /src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements
parent2a3780613676a2cd9fe912cbcce00c640463d67d (diff)
downloadSkyblock-Dungeons-Guide-0593c1b6390ddf7c92c6a5ddab3e31c5f6e59e7d.tar.gz
Skyblock-Dungeons-Guide-0593c1b6390ddf7c92c6a5ddab3e31c5f6e59e7d.tar.bz2
Skyblock-Dungeons-Guide-0593c1b6390ddf7c92c6a5ddab3e31c5f6e59e7d.zip
gui elements, better clip
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java
index 430ca07f..c77cb947 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java
@@ -18,9 +18,10 @@ public class MButton extends MPanel {
private Color foreground = Color.white;
private Color hover = Color.gray;
+ private Color clicked = Color.lightGray;
private Color disabled = Color.darkGray;
- private boolean enabled;
+ private boolean enabled = true;
private Runnable onActionPerformed;
@@ -34,7 +35,8 @@ public class MButton extends MPanel {
} else if (new Rectangle(new Point(0,0),bounds).contains(relMousex0, relMousey0)) {
bg = hover;
}
- Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB());
+ if (bg != null)
+ Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB());
FontRenderer renderer = Minecraft.getMinecraft().fontRendererObj;
int width = renderer.getStringWidth(text);