mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-13 17:27:35 +07:00
Added button to export crash logs
This commit is contained in:
@ -267,6 +267,9 @@ cancel = Cancel
|
|||||||
openlink = Open Link
|
openlink = Open Link
|
||||||
copylink = Copy Link
|
copylink = Copy Link
|
||||||
back = Back
|
back = Back
|
||||||
|
crash.export = Export Crash Logs
|
||||||
|
crash.none = No crash logs found.
|
||||||
|
crash.exported = Crash logs exported.
|
||||||
data.export = Export Data
|
data.export = Export Data
|
||||||
data.import = Import Data
|
data.import = Import Data
|
||||||
data.openfolder = Open Data Folder
|
data.openfolder = Open Data Folder
|
||||||
|
@ -195,6 +195,23 @@ public class SettingsMenuDialog extends SettingsDialog{
|
|||||||
t.row();
|
t.row();
|
||||||
t.button("@data.openfolder", Icon.folder, style, () -> Core.app.openFolder(Core.settings.getDataDirectory().absolutePath())).marginLeft(4);
|
t.button("@data.openfolder", Icon.folder, style, () -> Core.app.openFolder(Core.settings.getDataDirectory().absolutePath())).marginLeft(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
t.row();
|
||||||
|
|
||||||
|
t.button("@crash.export", Icon.upload, style, () -> {
|
||||||
|
if(settings.getDataDirectory().child("crashes").list().length == 0){
|
||||||
|
ui.showInfo("@crash.none");
|
||||||
|
}else{
|
||||||
|
platform.showFileChooser(false, "txt", file -> {
|
||||||
|
StringBuilder out = new StringBuilder();
|
||||||
|
for(Fi fi : settings.getDataDirectory().child("crashes").list()){
|
||||||
|
out.append(fi.name()).append("\n\n").append(fi.readString()).append("\n");
|
||||||
|
}
|
||||||
|
file.writeString(out.toString());
|
||||||
|
app.post(() -> ui.showInfo("@crash.exported"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).marginLeft(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
ScrollPane pane = new ScrollPane(prefs);
|
ScrollPane pane = new ScrollPane(prefs);
|
||||||
|
@ -12,6 +12,7 @@ import mindustry.*;
|
|||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.Saves.*;
|
import mindustry.game.Saves.*;
|
||||||
import mindustry.io.*;
|
import mindustry.io.*;
|
||||||
|
import mindustry.net.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
import org.robovm.apple.coregraphics.*;
|
import org.robovm.apple.coregraphics.*;
|
||||||
import org.robovm.apple.foundation.*;
|
import org.robovm.apple.foundation.*;
|
||||||
@ -248,7 +249,14 @@ public class IOSLauncher extends IOSApplication.Delegate{
|
|||||||
|
|
||||||
public static void main(String[] argv){
|
public static void main(String[] argv){
|
||||||
NSAutoreleasePool pool = new NSAutoreleasePool();
|
NSAutoreleasePool pool = new NSAutoreleasePool();
|
||||||
|
try{
|
||||||
UIApplication.main(argv, null, IOSLauncher.class);
|
UIApplication.main(argv, null, IOSLauncher.class);
|
||||||
|
}catch(Throwable t){
|
||||||
|
//attempt to log the exception
|
||||||
|
CrashSender.log(t);
|
||||||
|
//rethrow the exception so it actually crashes
|
||||||
|
throw t;
|
||||||
|
}
|
||||||
pool.close();
|
pool.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user