public static void DisplayValidatorMenu(Dictionary <string, IFolderValidator> validators) { if (InteractiveConsole.Menu.Selected.Items.Count > 0) { return; } foreach (var option in validators) { var sub = new ConsoleMenu.Item(option.Key, () => RunValidator(option.Value), 2) { IsToggle = true }; InteractiveConsole.Menu.Selected.Add(sub); } }
private static void DisplayOptionFolderDetailsMenu() { if (Menu.Selected.Items.Count > 0) { return; } foreach (var option in PreProcessing.OptionsSummary) { var sub = new ConsoleMenu.Item(option.Key, () => { Menu.Log.Clear(); Menu.WriteLine(option.Value); }); Menu.Selected.Add(sub); } }
private static void DisplayPatchesMenu() { if (Menu.Selected.Items.Count > 0) { return; } foreach (var patch in PreProcessing.CurrentChuniAppPatches) { var sub = new ConsoleMenu.Item($"{patch.Key,-30}\t{patch.Value}") { IsToggle = true }; sub.Action = () => { PreProcessing.CurrentChuniAppPatches[patch.Key] = PreProcessing.FlipChuniAppPatch(patch.Key); sub.Name = $"{patch.Key,-30}\t{PreProcessing.CurrentChuniAppPatches[patch.Key]}"; DisplayPatchesMenu(); }; Menu.Selected.Add(sub); } }
private static void DisplayUnlockerSubMenu(Option option) { InteractiveConsole.Menu.Selected.Clear(); var foldersWithUnlocks = option.OptionSubFolders.Where(x => x.Value.Any(y => y.XMLTags.Any())).ToList(); var flattenedSubFolders = foldersWithUnlocks.SelectMany(x => x.Value).ToList(); InteractiveConsole.Menu.Selected.Add(new ConsoleMenu.Item("Unlock All", () => Unlock(option.DirectoryInfo.FullName, flattenedSubFolders)) { ActionIfConfirmed = true }); InteractiveConsole.Menu.Selected.Add(new ConsoleMenu.Item("Restore All", () => Restore(option.DirectoryInfo.FullName, flattenedSubFolders)) { ActionIfConfirmed = true }); foreach (var optionSubFolder in foldersWithUnlocks) { var sub = new ConsoleMenu.Item(optionSubFolder.Key.ToString(), () => DisplayUnlockerRestoreOrUnlock(option.DirectoryInfo.FullName, optionSubFolder.Value)); InteractiveConsole.Menu.Selected.Add(sub); } }
public static void DisplayUnlockerMenu() { if (InteractiveConsole.Menu.Selected.Items.Count > 0) { return; } InteractiveConsole.Menu.Selected.Add(new ConsoleMenu.Item("Unlock Everything", UnlockEverything) { ActionIfConfirmed = true }); InteractiveConsole.Menu.Selected.Add(new ConsoleMenu.Item("Restore Everything", RestoreEverything) { ActionIfConfirmed = true }); foreach (var option in InteractiveConsole.PreProcessing.Options.Where(x => x.Value.OptionSubFolders.Any(y => y.Value.Any(z => z.XMLTags.Any())))) { var sub = new ConsoleMenu.Item(option.Key, () => DisplayUnlockerSubMenu(option.Value), 2); InteractiveConsole.Menu.Selected.Add(sub); } InteractiveConsole.Menu.WriteLine("Press Delete Scroll Backup."); }