Beispiel #1
0
        static void FixAllProblems()
        {
            int success = 0, fail = 0;

            foreach (SaveBugs bug in saveBugs)
            {
                try
                {
                    bug.Fix.Invoke();
                    success++;
                }
                catch
                {
                    fail++;
                }
            }

            string msg = $"<color=yellow>{success}</color> issue{(success > 1 ? "s have" : " has")} been fixed.";

            if (fail > 0)
            {
                msg += $"\n<color=red>{fail}</color> issue{(fail > 1 ? "s" : "")} couldn't be fixed.";
            }

            ModPrompt.CreatePrompt(msg, "MOP - Save Integrity Check");
        }
Beispiel #2
0
        /// <summary>
        /// Deletes the entire logs folder.
        /// </summary>
        public static void DeleteAllLogs()
        {
            if (!Directory.Exists($"{RootPath}/{LogFolder}"))
            {
                ModPrompt.CreatePrompt("Log folder doesn't exist.", "MOP");
                return;
            }

            ModPrompt.CreateYesNoPrompt("Are you sure you want to delete all logs?", "MOP", () => Directory.Delete($"{RootPath}/{LogFolder}", true));
        }
Beispiel #3
0
 public static void OpenCurrentSessionLogFolder()
 {
     if (ThisSessionLogDirectoryExists)
     {
         Process.Start(LogFolder);
     }
     else
     {
         ModPrompt.CreatePrompt("Logs folder doesn't exist.", "MOP");
     }
 }
Beispiel #4
0
 public static void OpenOutputLog()
 {
     if (File.Exists(OutputLogPath))
     {
         Process.Start(OutputLogPath);
     }
     else
     {
         ModPrompt.CreatePrompt("File \"output_log.txt\" doesn't exist.", "MOP");
     }
 }
Beispiel #5
0
        internal static void UpdatePerformanceMode()
        {
            // MODES
            // Show the warning about safe mode, if the player disables safe mode and is not in main menu.
            bool dontUpdate = false;

            if (ModLoader.CurrentScene != CurrentScene.MainMenu && IsModActive)
            {
                if (Mode == PerformanceMode.Safe && MOP.PerformanceModes.Value != 3)
                {
                    ModPrompt.CreatePrompt("Safe Mode will be disabled after the restart.", "MOP");
                    dontUpdate = true;
                }
                else if (Mode != PerformanceMode.Safe && MOP.PerformanceModes.Value == 3)
                {
                    ModPrompt.CreatePrompt("Safe Mode will be enabled after the restart.", "MOP");
                    dontUpdate = true;
                }

                if (!dontUpdate)
                {
                    switch (MOP.PerformanceModes.Value)
                    {
                    default:
                        Mode = PerformanceMode.Balanced;
                        break;

                    case 0:
                        Mode = PerformanceMode.Performance;
                        break;

                    case 1:
                        Mode = PerformanceMode.Balanced;
                        break;

                    case 2:
                        Mode = PerformanceMode.Quality;
                        break;

                    case 3:
                        Mode = PerformanceMode.Safe;
                        break;
                    }
                }
            }
        }