Add button

This commit is contained in:
Summet-V 2020-07-29 19:02:40 +03:00
parent 6236819f67
commit 8c310e38ff
2 changed files with 14 additions and 0 deletions

View File

@ -164,6 +164,13 @@ public class Saves{
return saves;
}
public void deleteAll(){
saves.clear();
for(Fi file : saveDirectory.list()){
file.delete();
}
}
public class SaveSlot{
public final Fi file;
boolean requestedPreview;

View File

@ -164,6 +164,13 @@ public class LoadDialog extends BaseDialog{
}
});
}).fillX().margin(10f);
buttons.button("$save.clear", Icon.trash, () -> {
ui.showConfirm("$confirm", "$save.clear.confirm", () -> {
control.saves.deleteAll();
setup();
});
}).fillX().margin(10f);
}
public void runLoadSave(SaveSlot slot){