mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-04-28 00:10:48 -07:00
Export last log with crashes
This commit is contained in:
parent
7e45d9b5b4
commit
c51fcd3839
2 changed files with 8 additions and 1 deletions
|
|
@ -203,10 +203,17 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||
ui.showInfo("@crash.none");
|
||||
}else{
|
||||
platform.showFileChooser(false, "txt", file -> {
|
||||
Fi log = settings.getDataDirectory().child("last_log.txt");
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
for(Fi fi : settings.getDataDirectory().child("crashes").list()){
|
||||
out.append(fi.name()).append("\n\n").append(fi.readString()).append("\n");
|
||||
}
|
||||
|
||||
if(log.exists()){
|
||||
out.append("\nlast log:\n").append(log.readString());
|
||||
}
|
||||
|
||||
file.writeString(out.toString());
|
||||
app.post(() -> ui.showInfo("@crash.exported"));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue