Exemple #1
0
 public virtual void UIRootOnGUI()
 {
     UnityGUIBugsFixer.OnGUI();
     Text.StartOfOnGUI();
     CheckOpenLogWindow();
     DelayedErrorWindowRequest.DelayedErrorWindowRequestOnGUI();
     DebugInputLogger.InputLogOnGUI();
     if (!screenshotMode.FiltersCurrentEvent)
     {
         debugWindowOpener.DevToolStarterOnGUI();
     }
     windows.HandleEventsHighPriority();
     screenshotMode.ScreenshotModesOnGUI();
     if (!screenshotMode.FiltersCurrentEvent)
     {
         TooltipHandler.DoTooltipGUI();
         feedbackFloaters.FeedbackOnGUI();
         DragSliderManager.DragSlidersOnGUI();
         Messages.MessagesDoGUI();
     }
     shortcutKeys.ShortcutKeysOnGUI();
     NoiseDebugUI.NoiseDebugOnGUI();
     Debug.developerConsoleVisible = false;
     if (Current.Game != null)
     {
         GameComponentUtility.GameComponentOnGUI();
     }
 }
 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());
         }
     }
 }
Exemple #3
0
        public static void ErrorWhileLoadingAssets(Exception e)
        {
            string text = "ErrorWhileLoadingAssets".Translate();

            if (ModsConfig.ActiveModsInLoadOrder.Any((ModMetaData x) => !x.Official) || !ModsConfig.ActiveModsInLoadOrder.Any((ModMetaData x) => x.IsCoreMod))
            {
                text += "\n\n" + "ErrorWhileLoadingAssets_ModsInfo".Translate();
            }
            DelayedErrorWindowRequest.Add(text, "ErrorWhileLoadingAssetsTitle".Translate());
            GenScene.GoToMainMenu();
        }
Exemple #4
0
        public static void ErrorWhileLoadingAssets(Exception e)
        {
            string text = "ErrorWhileLoadingAssets".Translate();

            if (ModsConfig.ActiveModsInLoadOrder.Count <ModMetaData>() != 1 || !ModsConfig.ActiveModsInLoadOrder.First <ModMetaData>().IsCoreMod)
            {
                text = text + "\n\n" + "ErrorWhileLoadingAssets_ModsInfo".Translate();
            }
            DelayedErrorWindowRequest.Add(text, "ErrorWhileLoadingAssetsTitle".Translate());
            GenScene.GoToMainMenu();
        }
Exemple #5
0
        public static void ErrorWhileLoadingGame(Exception e)
        {
            string text = "ErrorWhileLoadingMap".Translate();

            if (!ScribeMetaHeaderUtility.LoadedModsMatchesActiveMods(out string loadedModsSummary, out string runningModsSummary))
            {
                text += "\n\n" + "ModsMismatchWarningText".Translate(loadedModsSummary, runningModsSummary);
            }
            DelayedErrorWindowRequest.Add(text, "ErrorWhileLoadingMapTitle".Translate());
            Scribe.ForceStop();
            GenScene.GoToMainMenu();
        }
Exemple #6
0
        public static void ErrorWhileLoadingGame(Exception e)
        {
            string text  = "ErrorWhileLoadingMap".Translate();
            string text2 = default(string);
            string text3 = default(string);

            if (!ScribeMetaHeaderUtility.LoadedModsMatchesActiveMods(out text2, out text3))
            {
                text = text + "\n\n" + "ModsMismatchWarningText".Translate(text2, text3);
            }
            DelayedErrorWindowRequest.Add(text, "ErrorWhileLoadingMapTitle".Translate());
            Scribe.ForceStop();
            GenScene.GoToMainMenu();
        }
Exemple #7
0
 public static void ErrorWhileGeneratingMap(Exception e)
 {
     DelayedErrorWindowRequest.Add("ErrorWhileGeneratingMap".Translate(), "ErrorWhileGeneratingMapTitle".Translate());
     Scribe.ForceStop();
     GenScene.GoToMainMenu();
 }