private static void PerformSave(InProgressSave inProgress, Save save) { try { save.SaveToFile(); inProgress.ReportStatus(true, TranslationServer.Translate("SAVING_SUCCEEDED")); } catch (Exception e) { // ReSharper disable HeuristicUnreachableCode ConditionIsAlwaysTrueOrFalse if (!Constants.CATCH_SAVE_ERRORS) #pragma warning disable 162 { throw; } #pragma warning restore 162 inProgress.ReportStatus(false, TranslationServer.Translate("SAVING_FAILED"), e.ToString()); return; } if (inProgress.Type == SaveInformation.SaveType.AutoSave) { QueueRemoveExcessAutoSaves(); } if (inProgress.Type == SaveInformation.SaveType.QuickSave) { QueueRemoveExcessQuickSaves(); } }
private static void PerformSave(InProgressSave inProgress, Save save) { try { save.SaveToFile(); inProgress.ReportStatus(true, "Saving succeeded"); } catch (Exception e) { inProgress.ReportStatus(false, "Saving failed! An exception happened", e.ToString()); return; } if (inProgress.Type == SaveInformation.SaveType.QuickSave) { QueueRemoveExcessQuickSaves(); } }
private static bool PreventSavingIfExtinct(InProgressSave inProgress, Save save) { if (!save.SavedProperties.GameWorld.PlayerSpecies.IsExtinct) { return(false); } inProgress.ReportStatus(false, TranslationServer.Translate("SAVING_NOT_POSSIBLE"), TranslationServer.Translate("PLAYER_EXTINCT"), false); return(true); }
private static void PerformSave(InProgressSave inProgress, Save save) { try { save.SaveToFile(); inProgress.ReportStatus(true, TranslationServer.Translate("SAVING_SUCCEEDED")); } catch (Exception e) { inProgress.ReportStatus(false, TranslationServer.Translate("SAVING_FAILED"), e.ToString()); return; } if (inProgress.Type == SaveInformation.SaveType.AutoSave) { QueueRemoveExcessAutoSaves(); } if (inProgress.Type == SaveInformation.SaveType.QuickSave) { QueueRemoveExcessQuickSaves(); } }