/// <summary>
        /// Read a save file
        /// </summary>
        /// <param name="filepath">The path to the savefile</param>
        private static void Read(string filepath)
        {
            Main.LogDebug("reading {0}", filepath);

            Scribe.SaveState();
            Scribe.InitLoadingMetaHeaderOnly(filepath);
            ScribeMetaHeaderUtility.LoadGameDataHeader(ScribeMetaHeaderUtility.ScribeHeaderMode.Map, false);
            importList = ScribeMetaHeaderUtility.loadedModIdsList;
            Scribe.FinalizeLoading();
            Scribe.RestoreState();
        }
예제 #2
0
        internal static void _CheckVersionAndLoad(string path, ScribeMetaHeaderUtility.ScribeHeaderMode mode, Action loadAct)
        {
            bool mismatchWarnings;

            try
            {
                try
                {
                    Scribe.InitLoadingMetaHeaderOnly(path);
                }
                catch (Exception ex)
                {
                    Log.Warning(string.Concat(new object[4]
                    {
                        (object)"Exception loading ",
                        (object)path,
                        (object)": ",
                        (object)ex
                    }));
                }
                ScribeMetaHeaderUtility.LoadGameDataHeader(mode, false);
                mismatchWarnings = ScribeMetaHeaderUtility.TryCreateDialogsForVersionMismatchWarnings(loadAct);
                CrossRefResolver.ResolveAllCrossReferences();
                PostLoadInitter.DoAllPostLoadInits();
            }
            catch
            {
                CrossRefResolver.Clear();
                PostLoadInitter.Clear();
                throw;
            }
            Controller.Data.ResetInjectionSubController();
            if (mismatchWarnings)
            {
                return;
            }
            loadAct();
        }