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(); }
public static void load(ref List <Thing> thingsToLoad, string fileLocation, Thing currentSource) { Log.Message("ScribeINIT, loding from:" + fileLocation); Scribe.InitLoading(fileLocation); //Scribe.EnterNode("Stargate"); Log.Message("DeepProfiler.Start()"); DeepProfiler.Start("Load non-compressed things"); // List<Thing> list2 = (List<Thing>)null; Log.Message("Scribe_Collections.LookList"); Scribe_Collections.LookList <Thing>(ref thingsToLoad, "things", LookMode.Deep); Log.Message("List1Count:" + thingsToLoad.Count); Log.Message("DeepProfiler.End()"); DeepProfiler.End(); //Scribe.ExitNode(); Scribe.mode = LoadSaveMode.Inactive; //Log.Message("list: " + thingsToLoad.Count.ToString()); Log.Message("Exit Node"); //Scribe.ExitNode(); Log.Message("ResolveAllCrossReferences"); CrossRefResolver.ResolveAllCrossReferences(); Log.Message("DoAllPostLoadInits"); PostLoadInitter.DoAllPostLoadInits(); Log.Message("Return"); }