Esempio n. 1
0
        public static bool LoadGame(string filename)
        {
            ConfigNode configNode = GamePersistence.LoadSFSFile(filename, HighLogic.SaveFolder);

            if (configNode == null)
            {
                ScreenMessages.PostScreenMessage("<color=orange>Unable to load the save: " + filename, 5f, ScreenMessageStyle.UPPER_LEFT);
                return(false);
            }
            var v = NodeUtil.GetCfgVersion(configNode, LoadContext.SFS);

            KSPUpgradePipeline.Process(configNode, HighLogic.SaveFolder, LoadContext.SFS,
                                       node => onPipelineFinished(node, filename, v),
                                       (opt, node) =>
                                       ScreenMessages.PostScreenMessage(string.Format("<color=orange>Unable to load the save: {0}\n" +
                                                                                      "KSPUpgradePipeline finished with error.", filename),
                                                                        5f, ScreenMessageStyle.UPPER_LEFT));
            return(true);
        }