aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java
index 7e9e42cb..94f79f7d 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java
@@ -22,9 +22,10 @@ public class MStringSelectionButton extends MPanel {
@Setter
private Runnable onUpdate;
- public MStringSelectionButton(final List<String> possible) {
+ public MStringSelectionButton(final List<String> possible, String defaultValue) {
this.possible = possible;
- selectedIndex = 0;
+ selectedIndex = possible.indexOf(defaultValue);
+ if (selectedIndex == -1) selectedIndex = 0;
dec = new MButton(); dec.setText("<"); add(dec);
inc = new MButton(); inc.setText(">"); add(inc);