Fixed #1672
This commit is contained in:
@@ -90,6 +90,13 @@ public class SchematicsDialog extends FloatingDialog{
|
||||
|
||||
buttons.addImageButton(Icon.pencil, style, () -> {
|
||||
ui.showTextInput("$schematic.rename", "$name", s.name(), res -> {
|
||||
Schematic replacement = schematics.all().find(other -> other.name().equals(res) && other != s);
|
||||
if(replacement != null){
|
||||
//renaming to an existing schematic is not allowed, as it is not clear how the tags would be merged, and which one should be removed
|
||||
ui.showErrorMessage("$schematic.exists");
|
||||
return;
|
||||
}
|
||||
|
||||
s.tags.put("name", res);
|
||||
s.save();
|
||||
rebuildPane[0].run();
|
||||
|
||||
Reference in New Issue
Block a user