aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
diff options
context:
space:
mode:
authorBuildTools <james.jenour@protonmail.com>2021-01-13 10:17:56 +0800
committerBuildTools <james.jenour@protonmail.com>2021-01-13 10:17:56 +0800
commitc9cc530adfb39085fe4b0f9a60e0ca6e4bbb8eb9 (patch)
treedb49b22c6e50775f6c49e5172f71dc662b657598 /src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
parentcfa0aa0c9a24aa739d3254b24ef4bf0bea7087a6 (diff)
downloadnotenoughupdates-c9cc530adfb39085fe4b0f9a60e0ca6e4bbb8eb9.tar.gz
notenoughupdates-c9cc530adfb39085fe4b0f9a60e0ca6e4bbb8eb9.tar.bz2
notenoughupdates-c9cc530adfb39085fe4b0f9a60e0ca6e4bbb8eb9.zip
2.0 PRE6
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
index e962f793..5677bf9e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java
@@ -177,9 +177,42 @@ public class GuiDungeonMapEditor extends GuiScreen {
//buttons.add(new Button(29, 52, 86+19, "XLarge", options.dmRoomSize));
//buttons.add(new Button(30, 52, 56, "XLarge", options.dmBorderSize));
- xField.setText(String.valueOf(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmCenterX));
- yField.setText(String.valueOf(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmCenterY));
- blurField.setText(String.valueOf(NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBackgroundBlur));
+ {
+ double val = NotEnoughUpdates.INSTANCE.config.dungeonMap.dmCenterX;
+ String strVal;
+ if(val % 1 == 0) {
+ strVal = Integer.toString((int)val);
+ } else {
+ strVal = Double.toString(val);
+ strVal = strVal.replaceAll("(\\.\\d\\d\\d)(?:\\d)+", "$1");
+ strVal = strVal.replaceAll("0+$", "");
+ }
+ xField.setText(strVal);
+ }
+ {
+ double val = NotEnoughUpdates.INSTANCE.config.dungeonMap.dmCenterY;
+ String strVal;
+ if(val % 1 == 0) {
+ strVal = Integer.toString((int)val);
+ } else {
+ strVal = Double.toString(val);
+ strVal = strVal.replaceAll("(\\.\\d\\d\\d)(?:\\d)+", "$1");
+ strVal = strVal.replaceAll("0+$", "");
+ }
+ yField.setText(strVal);
+ }
+ {
+ double val = NotEnoughUpdates.INSTANCE.config.dungeonMap.dmBackgroundBlur;
+ String strVal;
+ if(val % 1 == 0) {
+ strVal = Integer.toString((int)val);
+ } else {
+ strVal = Double.toString(val);
+ strVal = strVal.replaceAll("(\\.\\d\\d\\d)(?:\\d)+", "$1");
+ strVal = strVal.replaceAll("0+$", "");
+ }
+ blurField.setText(strVal);
+ }
}
@Override