From 84011d2cc383aec605b13c2cfaa31e68d1af5604 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Thu, 24 Dec 2020 12:51:33 +0900 Subject: configuration --- .../java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java | 4 ++-- .../dungeonsguide/roomedit/elements/MIntegerSelectionButton.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements') 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 866951ab..18aeef41 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MButton.java @@ -39,11 +39,11 @@ public class MButton extends MPanel { Gui.drawRect(0,0,bounds.width, bounds.height, bg.getRGB()); FontRenderer renderer = Minecraft.getMinecraft().fontRendererObj; - int width = renderer.getStringWidth(text); + int width = renderer.getStringWidth(getText()); int x = (bounds.width - width) / 2; int y = (bounds.height - renderer.FONT_HEIGHT) / 2; - renderer.drawString(text, x,y, foreground.getRGB()); + renderer.drawString(getText(), x,y, foreground.getRGB()); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java index 9ba6350a..fc5ef5c0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MIntegerSelectionButton.java @@ -31,6 +31,7 @@ public class MIntegerSelectionButton extends MPanel { public void edit(String str) { try { data = Integer.parseInt(str); + onUpdate.run(); } catch (Exception e) {} } }; updateSelected(); add(selected); -- cgit