don't show desc at schem save

This commit is contained in:
summetdev 2020-10-10 20:28:43 +03:00
parent bdc69249bb
commit d94fdfa50f

View File

@ -490,7 +490,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
protected void showSchematicSave(){
if(lastSchematic == null) return;
Cons2<String, String> saveSchematic = (text, description) -> {
ui.showTextInput("@schematic.add", "@name", "", text -> {
Schematic replacement = schematics.all().find(s -> s.name().equals(text));
if(replacement != null){
ui.showConfirm("@confirm", "@schematic.replace", () -> {
@ -500,40 +500,12 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
});
}else{
lastSchematic.tags.put("name", text);
lastSchematic.tags.put("description", description);
lastSchematic.tags.put("description", "");
schematics.add(lastSchematic);
ui.showInfoFade("@schematic.saved");
ui.schematics.showInfo(lastSchematic);
}
};
new Dialog("@schematic.add"){{
cont.margin(30).add("@name").padRight(6f);
TextField nameField = cont.field("", t -> {}).size(330f, 50f).addInputDialog().get();
cont.row();
cont.margin(30).add("@editor.description").padRight(6f);
TextField descripionField = cont.field("", t -> {}).size(330f, 50f).addInputDialog().get();
buttons.defaults().size(120, 54).pad(4);
buttons.button("@ok", () -> {
saveSchematic.get(nameField.getText(), descripionField.getText());
hide();
}).disabled(b -> nameField.getText().isEmpty());
buttons.button("@cancel", this::hide);
keyDown(KeyCode.enter, () -> {
String text = nameField.getText();
if(!text.isEmpty()){
saveSchematic.get(text, descripionField.getText());
hide();
}
});
keyDown(KeyCode.escape, this::hide);
keyDown(KeyCode.back, this::hide);
show();
}};
});
}
public void rotateRequests(Seq<BuildPlan> requests, int direction){