Added native file choosers for importing/exporting save

This commit is contained in:
Anuken
2018-05-24 23:16:03 -04:00
parent 519d2c1714
commit f524be6738
4 changed files with 23 additions and 13 deletions

View File

@@ -20,8 +20,9 @@ public class DesktopLauncher {
config.setMaximized(true);
config.setWindowedMode(960, 540);
config.setWindowIcon("sprites/icon.png");
if(OS.isMac) {
config.setPreferencesConfig(UCore.getProperty("user.home") + "/Library/Application Support/", FileType.Absolute);
config.setPreferencesConfig(UCore.getProperty("user.home") + "/Library/Application Support/Mindustry", FileType.Absolute);
}
Platform.instance = new DesktopPlatform(arg);

View File

@@ -55,6 +55,7 @@ public class DesktopPlatform extends Platform {
FxApp.cons = cons;
FxApp.filter = filter;
FxApp.open = open;
FxApp.content = content;
FxApp.open();
}){{
setDaemon(true);
@@ -208,7 +209,7 @@ public class DesktopPlatform extends Platform {
file = chooser.showSaveDialog(null);
}
if (file != null) {
cons.accept(Gdx.files.absolute(file.getAbsolutePath()));
Gdx.app.postRunnable(() -> cons.accept(Gdx.files.absolute(file.getAbsolutePath())));
}
}
}