コード例 #1
0
 public static void SelectLanguage(LoadedLanguage lang)
 {
     Prefs.LangFolderName = lang.folderName;
     LongEventHandler.QueueLongEvent(delegate()
     {
         PlayDataLoader.ClearAllPlayData();
         PlayDataLoader.LoadAllPlayData(false);
     }, "LoadingLongEvent", true, null);
 }
コード例 #2
0
 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());
         }
     }
 }
コード例 #3
0
ファイル: Root.cs プロジェクト: Chillu1/RimWorldDecompiledWeb
 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);
     }
 }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
 private static void <SelectLanguage> m__0()
 {
     PlayDataLoader.ClearAllPlayData();
     PlayDataLoader.LoadAllPlayData(false);
 }
コード例 #7
0
ファイル: Root.cs プロジェクト: aihhr1832/RimWorld-Decompile
 private static void <Start> m__1()
 {
     PlayDataLoader.LoadAllPlayData(false);
 }