public static bool TryCreateDialogsForVersionMismatchWarnings(Action confirmedAction) { string text = null; string text2 = null; if (!BackCompatibility.IsSaveCompatibleWith(ScribeMetaHeaderUtility.loadedGameVersion) && !ScribeMetaHeaderUtility.VersionsMatch()) { text2 = "VersionMismatch".Translate(); string text3 = (!ScribeMetaHeaderUtility.loadedGameVersion.NullOrEmpty()) ? ScribeMetaHeaderUtility.loadedGameVersion : ("(" + "UnknownLower".Translate() + ")"); text = ((ScribeMetaHeaderUtility.lastMode != ScribeHeaderMode.Map) ? ((ScribeMetaHeaderUtility.lastMode != ScribeHeaderMode.World) ? "FileIncompatibleWarning".Translate(text3, VersionControl.CurrentVersionString) : "WorldFileVersionMismatch".Translate(text3, VersionControl.CurrentVersionString)) : "SaveGameIncompatibleWarningText".Translate(text3, VersionControl.CurrentVersionString)); } bool flag = false; string text4 = default(string); string text5 = default(string); if (!ScribeMetaHeaderUtility.LoadedModsMatchesActiveMods(out text4, out text5)) { flag = true; string text6 = "ModsMismatchWarningText".Translate(text4, text5); text = ((text != null) ? (text + "\n\n" + text6) : text6); if (text2 == null) { text2 = "ModsMismatchWarningTitle".Translate(); } } if (text != null) { string text7 = text; string title = text2; Dialog_MessageBox dialog = Dialog_MessageBox.CreateConfirmation(text7, confirmedAction, false, title); dialog.buttonAText = "LoadAnyway".Translate(); if (flag) { dialog.buttonCText = "ChangeLoadedMods".Translate(); dialog.buttonCAction = delegate { int num = ModLister.InstalledModsListHash(false); ModsConfig.SetActiveToList(ScribeMetaHeaderUtility.loadedModIdsList); ModsConfig.Save(); if (num == ModLister.InstalledModsListHash(false)) { IEnumerable <string> items = from id in Enumerable.Range(0, ScribeMetaHeaderUtility.loadedModIdsList.Count) where ModLister.GetModWithIdentifier(ScribeMetaHeaderUtility.loadedModIdsList[id]) == null select ScribeMetaHeaderUtility.loadedModNamesList[id]; Messages.Message(string.Format("{0}: {1}", "MissingMods".Translate(), GenText.ToCommaList(items, true)), MessageTypeDefOf.RejectInput); dialog.buttonCClose = false; } else { ModsConfig.RestartFromChangedMods(); } }; } Find.WindowStack.Add(dialog); return(true); } return(false); }
public static bool TryCreateDialogsForVersionMismatchWarnings(Action confirmedAction) { string text = null; string text2 = null; if (!BackCompatibility.IsSaveCompatibleWith(ScribeMetaHeaderUtility.loadedGameVersion) && !ScribeMetaHeaderUtility.VersionsMatch()) { text2 = "VersionMismatch".Translate(); string value = (!ScribeMetaHeaderUtility.loadedGameVersion.NullOrEmpty()) ? ScribeMetaHeaderUtility.loadedGameVersion : ("(" + "UnknownLower".Translate() + ")"); if (ScribeMetaHeaderUtility.lastMode == ScribeMetaHeaderUtility.ScribeHeaderMode.Map) { text = "SaveGameIncompatibleWarningText".Translate(value, VersionControl.CurrentVersionString); } else if (ScribeMetaHeaderUtility.lastMode == ScribeMetaHeaderUtility.ScribeHeaderMode.World) { text = "WorldFileVersionMismatch".Translate(value, VersionControl.CurrentVersionString); } else { text = "FileIncompatibleWarning".Translate(value, VersionControl.CurrentVersionString); } } bool flag = false; string value2; string value3; if (!ScribeMetaHeaderUtility.LoadedModsMatchesActiveMods(out value2, out value3)) { flag = true; string text3 = "ModsMismatchWarningText".Translate(value2, value3); if (text == null) { text = text3; } else { text = text + "\n\n" + text3; } if (text2 == null) { text2 = "ModsMismatchWarningTitle".Translate(); } } if (text != null) { ScribeMetaHeaderUtility.< TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey0 <TryCreateDialogsForVersionMismatchWarnings> c__AnonStorey = new ScribeMetaHeaderUtility.< TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey0(); ScribeMetaHeaderUtility.< TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey0 arg_14A_0 = < TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey; string text4 = text; string title = text2; arg_14A_0.dialog = Dialog_MessageBox.CreateConfirmation(text4, confirmedAction, false, title);
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(); }
public static bool TryCreateDialogsForVersionMismatchWarnings(Action confirmedAction) { string text = null; string text2 = null; if (!BackCompatibility.IsSaveCompatibleWith(ScribeMetaHeaderUtility.loadedGameVersion) && !ScribeMetaHeaderUtility.VersionsMatch()) { text2 = "VersionMismatch".Translate(); string text3 = (!ScribeMetaHeaderUtility.loadedGameVersion.NullOrEmpty()) ? ScribeMetaHeaderUtility.loadedGameVersion : ("(" + "UnknownLower".Translate() + ")"); if (ScribeMetaHeaderUtility.lastMode == ScribeMetaHeaderUtility.ScribeHeaderMode.Map) { text = "SaveGameIncompatibleWarningText".Translate(new object[] { text3, VersionControl.CurrentVersionString }); } else if (ScribeMetaHeaderUtility.lastMode == ScribeMetaHeaderUtility.ScribeHeaderMode.World) { text = "WorldFileVersionMismatch".Translate(new object[] { text3, VersionControl.CurrentVersionString }); } else { text = "FileIncompatibleWarning".Translate(new object[] { text3, VersionControl.CurrentVersionString }); } } bool flag = false; string text4; string text5; if (!ScribeMetaHeaderUtility.LoadedModsMatchesActiveMods(out text4, out text5)) { flag = true; string text6 = "ModsMismatchWarningText".Translate(new object[] { text4, text5 }); if (text == null) { text = text6; } else { text = text + "\n\n" + text6; } if (text2 == null) { text2 = "ModsMismatchWarningTitle".Translate(); } } bool result; if (text != null) { ScribeMetaHeaderUtility.< TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey0 <TryCreateDialogsForVersionMismatchWarnings> c__AnonStorey = new ScribeMetaHeaderUtility.< TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey0(); ScribeMetaHeaderUtility.< TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey0 <TryCreateDialogsForVersionMismatchWarnings> c__AnonStorey2 = < TryCreateDialogsForVersionMismatchWarnings > c__AnonStorey; string text7 = text; string title = text2;