This commit is contained in:
Anuken
2023-01-07 13:15:56 -05:00
parent 54a9955e30
commit 246591eab4
4 changed files with 19 additions and 7 deletions

View File

@@ -192,12 +192,18 @@ public class LoadDialog extends BaseDialog{
buttons.button("@save.import", Icon.add, () -> {
platform.showFileChooser(true, saveExtension, file -> {
if(SaveIO.isSaveValid(file)){
try{
control.saves.importSave(file);
rebuild();
}catch(IOException e){
e.printStackTrace();
ui.showException("@save.import.fail", e);
var meta = SaveIO.getMeta(file);
if(meta.rules.sector != null){
ui.showErrorMessage("@save.nocampaign");
}else{
try{
control.saves.importSave(file);
rebuild();
}catch(IOException e){
e.printStackTrace();
ui.showException("@save.import.fail", e);
}
}
}else{
ui.showErrorMessage("@save.import.invalid");