Added native file choosers for importing/exporting save
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user