From 708c5d2f75060c17ffc7864c53b6ed7f15df3d7d Mon Sep 17 00:00:00 2001 From: syeyoung Date: Wed, 4 Aug 2021 15:27:06 +0900 Subject: - Fix Edit not working --- .../syeyoung/dungeonsguide/config/guiconfig/nyu/MParameterEdit.java | 5 ++--- .../syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java | 5 +++++ .../dungeonsguide/gui/elements/MIntegerSelectionButton.java | 6 ++++++ .../java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java | 6 ++++++ .../java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java | 5 +++++ 5 files changed, 24 insertions(+), 3 deletions(-) (limited to 'src/main') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MParameterEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MParameterEdit.java index 4bf958db..b0fd43f0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MParameterEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/config/guiconfig/nyu/MParameterEdit.java @@ -143,9 +143,8 @@ public class MParameterEdit extends MPanel { @Override public Dimension getPreferredSize() { FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; - int descriptionHeight = fr.listFormattedStringToWidth(featureParameter.getDescription(), 2*bounds.width /3-10).size() * fr.FONT_HEIGHT; - - return new Dimension(100, Math.max(Math.max(30, descriptionHeight + 23), valueEditHolder.getPreferredSize().height)); + int descriptionHeight = fr.listFormattedStringToWidth(featureParameter.getDescription(), Math.max(50, 2*bounds.width/3-10)).size() * fr.FONT_HEIGHT; + return new Dimension(100, Math.max(30, descriptionHeight + 23)); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java index 3920e288..99d7b322 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MFloatSelectionButton.java @@ -75,6 +75,11 @@ public class MFloatSelectionButton extends MPanel { }); } + @Override + public Dimension getPreferredSize() { + return new Dimension(-1,15); + } + public float getSelected() { return data; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java index a8519509..9f5ac258 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MIntegerSelectionButton.java @@ -71,6 +71,12 @@ public class MIntegerSelectionButton extends MPanel { }); } + + @Override + public Dimension getPreferredSize() { + return new Dimension(-1,15); + } + public int getSelected() { return data; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java index 827dc3e8..b40acd02 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MTextField.java @@ -58,6 +58,12 @@ public class MTextField extends MPanel { public void edit(String str) { } + + + @Override + public Dimension getPreferredSize() { + return new Dimension(-1,15); + } public void setText(String text) { this.text = text; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java index 3c223d84..4d1e6fb7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/gui/elements/MToggleButton.java @@ -74,6 +74,11 @@ public class MToggleButton extends MPanel { } } + @Override + public Dimension getPreferredSize() { + return new Dimension(40,15); + } + @Override public void mouseClicked(int absMouseX, int absMouseY, int relMouseX, int relMouseY, int mouseButton) { if (onToggle != null && lastAbsClip.contains(absMouseX, absMouseY) && getTooltipsOpen() == 0) { -- cgit