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"); }
/// <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)); }
public static void OpenCurrentSessionLogFolder() { if (ThisSessionLogDirectoryExists) { Process.Start(LogFolder); } else { ModPrompt.CreatePrompt("Logs folder doesn't exist.", "MOP"); } }
public static void OpenOutputLog() { if (File.Exists(OutputLogPath)) { Process.Start(OutputLogPath); } else { ModPrompt.CreatePrompt("File \"output_log.txt\" doesn't exist.", "MOP"); } }
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; } } } }