def saveGame(self): logging.info("Saving game") if self.game.savepath: persistency.save_game(self.game) liberation_install.setup_last_save_file(self.game.savepath) liberation_install.save_config() else: self.saveGameAs()
def saveGameAs(self): file = QFileDialog.getSaveFileName( self, "Save As", dir=persistency._dcs_saved_game_folder, filter="*.liberation") if file is not None: self.game.savepath = file[0] persistency.save_game(self.game) liberation_install.setup_last_save_file(self.game.savepath) liberation_install.save_config()
def saveGameAs(self): if self.game is not None and self.game.savepath: save_dir = self.game.savepath else: save_dir = str(persistency.save_dir()) file = QFileDialog.getSaveFileName( self, "Save As", dir=save_dir, filter="*.liberation", ) if file is not None: self.game.savepath = file[0] persistency.save_game(self.game) liberation_install.setup_last_save_file(self.game.savepath) liberation_install.save_config() self.updateWindowTitle(file[0])