This commit is contained in:
Anuken
2020-03-09 09:41:39 -04:00
parent 7aa71f38c3
commit d7f9090c0b
4 changed files with 23 additions and 5 deletions

View File

@ -255,10 +255,19 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(lastSchematic == null) return;
ui.showTextInput("$schematic.add", "$name", "", text -> {
lastSchematic.tags.put("name", text);
schematics.add(lastSchematic);
ui.showInfoFade("$schematic.saved");
ui.schematics.showInfo(lastSchematic);
Schematic replacement = schematics.all().find(s -> s.name().equals(text));
if(replacement != null){
ui.showConfirm("$confirm", "$schematic.replace", () -> {
schematics.overwrite(replacement, lastSchematic);
ui.showInfoFade("$schematic.saved");
ui.schematics.showInfo(replacement);
});
}else{
lastSchematic.tags.put("name", text);
schematics.add(lastSchematic);
ui.showInfoFade("$schematic.saved");
ui.schematics.showInfo(lastSchematic);
}
});
}