This commit is contained in:
Anuken
2019-09-17 19:25:37 -04:00
parent 5e8da856e7
commit 0ceb58a105
4 changed files with 12 additions and 30 deletions

View File

@@ -53,12 +53,18 @@ public class MapsDialog extends FloatingDialog{
buttons.addImageTextButton("$editor.newmap", Icon.add, () -> {
ui.showTextInput("$editor.newmap", "$name", "", text -> {
ui.loadAnd(() -> {
Runnable show = () -> ui.loadAnd(() -> {
hide();
ui.editor.show();
ui.editor.editor.getTags().put("name", text);
Events.fire(new MapMakeEvent());
});
if(maps.byName(text) != null){
ui.showErrorMessage("$editor.exists");
}else{
show.run();
}
});
}).size(210f, 64f);