public static void SelectLanguage(LoadedLanguage lang) { Prefs.LangFolderName = lang.folderName; LongEventHandler.QueueLongEvent(delegate() { PlayDataLoader.ClearAllPlayData(); PlayDataLoader.LoadAllPlayData(false); }, "LoadingLongEvent", true, null); }
public static void LoadAllPlayData(bool recovering = false) { if (PlayDataLoader.loadedInt) { Log.Error("Loading play data when already loaded. Call ClearAllPlayData first."); } else { DeepProfiler.Start("LoadAllPlayData"); try { PlayDataLoader.DoPlayLoad(); } catch (Exception arg) { if (!Prefs.ResetModsConfigOnCrash) { throw; } if (recovering) { Log.Warning("Could not recover from errors loading play data. Giving up."); throw; } IEnumerable <ModMetaData> activeModsInLoadOrder = ModsConfig.ActiveModsInLoadOrder; if (activeModsInLoadOrder.Count() == 1 && activeModsInLoadOrder.First().IsCoreMod) { throw; } Log.Warning("Caught exception while loading play data but there are active mods other than Core. Resetting mods config and trying again.\nThe exception was: " + arg); try { PlayDataLoader.ClearAllPlayData(); } catch { Log.Warning("Caught exception while recovering from errors and trying to clear all play data. Ignoring it.\nThe exception was: " + arg); } ModsConfig.Reset(); DirectXmlCrossRefLoader.Clear(); PlayDataLoader.LoadAllPlayData(true); return; } finally { DeepProfiler.End(); } PlayDataLoader.loadedInt = true; if (recovering) { Log.Message("Successfully recovered from errors and loaded play data."); DelayedErrorWindowRequest.Add("RecoveredFromErrorsText".Translate(), "RecoveredFromErrorsDialogTitle".Translate()); } } }
public virtual void Start() { try { CultureInfoUtility.EnsureEnglish(); Current.Notify_LoadedSceneChanged(); CheckGlobalInit(); Action action = delegate { DeepProfiler.Start("Misc Init (InitializingInterface)"); try { soundRoot = new SoundRoot(); if (GenScene.InPlayScene) { uiRoot = new UIRoot_Play(); } else if (GenScene.InEntryScene) { uiRoot = new UIRoot_Entry(); } uiRoot.Init(); Messages.Notify_LoadedLevelChanged(); if (Current.SubcameraDriver != null) { Current.SubcameraDriver.Init(); } } finally { DeepProfiler.End(); } }; if (!PlayDataLoader.Loaded) { Application.runInBackground = true; LongEventHandler.QueueLongEvent(delegate { PlayDataLoader.LoadAllPlayData(); }, null, doAsynchronously: true, null); LongEventHandler.QueueLongEvent(action, "InitializingInterface", doAsynchronously: false, null); } else { action(); } } catch (Exception arg) { Log.Error("Critical error in root Start(): " + arg); } }
public virtual void Start() { try { CultureInfoUtility.EnsureEnglish(); Current.Notify_LoadedSceneChanged(); Root.CheckGlobalInit(); Action action = delegate { this.soundRoot = new SoundRoot(); if (GenScene.InPlayScene) { this.uiRoot = new UIRoot_Play(); } else if (GenScene.InEntryScene) { this.uiRoot = new UIRoot_Entry(); } this.uiRoot.Init(); Messages.Notify_LoadedLevelChanged(); if (Current.SubcameraDriver != null) { Current.SubcameraDriver.Init(); } }; if (!PlayDataLoader.Loaded) { LongEventHandler.QueueLongEvent(delegate { PlayDataLoader.LoadAllPlayData(false); }, null, true, null); LongEventHandler.QueueLongEvent(action, "InitializingInterface", false, null); } else { action(); } } catch (Exception arg) { Log.Error("Critical error in root Start(): " + arg, false); } }
public virtual void Start() { Current.Notify_LoadedSceneChanged(); Root.CheckGlobalInit(); Action action = delegate { this.soundRoot = new SoundRoot(); if (GenScene.InPlayScene) { this.uiRoot = new UIRoot_Play(); } else if (GenScene.InEntryScene) { this.uiRoot = new UIRoot_Entry(); } this.uiRoot.Init(); Messages.Notify_LoadedLevelChanged(); if (Current.SubcameraDriver != null) { Current.SubcameraDriver.Init(); } }; if (!PlayDataLoader.Loaded) { LongEventHandler.QueueLongEvent(delegate { PlayDataLoader.LoadAllPlayData(false); }, null, true, null); LongEventHandler.QueueLongEvent(action, "InitializingInterface", false, null); } else { action(); } }
private static void <SelectLanguage> m__0() { PlayDataLoader.ClearAllPlayData(); PlayDataLoader.LoadAllPlayData(false); }
private static void <Start> m__1() { PlayDataLoader.LoadAllPlayData(false); }