diff options
author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-12-14 18:16:02 +0900 |
---|---|---|
committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-12-14 18:16:02 +0900 |
commit | 54b2804d7ff5c1d560893376070979d993ef0580 (patch) | |
tree | 5b4f0eb23adb3c231e209b6d1ef99d9794828d37 /src/main/java/kr/syeyoung/dungeonsguide | |
parent | 963dada297f02a24ea1a8b0c1dbc2cbfb27e7bd1 (diff) | |
download | Skyblock-Dungeons-Guide-54b2804d7ff5c1d560893376070979d993ef0580.tar.gz Skyblock-Dungeons-Guide-54b2804d7ff5c1d560893376070979d993ef0580.tar.bz2 Skyblock-Dungeons-Guide-54b2804d7ff5c1d560893376070979d993ef0580.zip |
better class display
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java | 6 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java | 6 |
2 files changed, 11 insertions, 1 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 94f79f7d..088a1bd9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/elements/MStringSelectionButton.java @@ -51,6 +51,10 @@ public class MStringSelectionButton extends MPanel { }); } + public String selectionToDisplay(String selection) { + return selection; + } + public String getSelected() { if (possible.size() == 0) return null; return possible.get(selectedIndex); @@ -58,7 +62,7 @@ public class MStringSelectionButton extends MPanel { private void updateSelected() { if (possible.size() == 0) selected.setText("-Empty-"); - else selected.setText(possible.get(selectedIndex)); + else selected.setText(selectionToDisplay(possible.get(selectedIndex))); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java index 21b05bfd..777f9736 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonParameterEdit.java @@ -61,6 +61,12 @@ public class GuiDungeonParameterEdit extends GuiScreen { public void resize(int parentWidth, int parentHeight) { setBounds(new Rectangle(0, 20, parentWidth,20)); } + + @Override + public String selectionToDisplay(String selection) { + String[] split = selection.split("\\."); + return super.selectionToDisplay(split[split.length - 1]); + } }; mStringSelectionButton.setOnUpdate(new Runnable() { |