diff --git a/RombaSharp/RombaSharp.cs b/RombaSharp/RombaSharp.cs index 7e0bb99e..09c95bc2 100644 --- a/RombaSharp/RombaSharp.cs +++ b/RombaSharp/RombaSharp.cs @@ -67,7 +67,7 @@ namespace RombaSharp // Credits take precidence over all if ((new List(args)).Contains("--credits")) { - Build.Help("Credits"); + _help.OutputCredits(); _logger.Close(); return; } diff --git a/SabreTools.Helper/Data/Build.cs b/SabreTools.Helper/Data/Build.cs index d7d67613..fc5f663a 100644 --- a/SabreTools.Helper/Data/Build.cs +++ b/SabreTools.Helper/Data/Build.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; namespace SabreTools.Helper.Data { @@ -56,71 +55,5 @@ namespace SabreTools.Helper.Data } } } - - /// - /// Show the help dialog for a given class - /// - /// Name of the class to get help for, "Credits" for developer credits - public static void Help(string className, string subset = null) - { - //http://stackoverflow.com/questions/14849367/how-to-determine-calling-method-and-class-name - string barrier = "-----------------------------------------"; - List helptext = new List(); - - // Normalize the subset text - if (subset != null) - { - subset = subset.ToLowerInvariant().TrimStart('-'); - } - - // Set the help text - switch (className) - { - case "Credits": - helptext.Add(barrier); - helptext.Add("Credits"); - helptext.Add(barrier); - helptext.Add(""); - helptext.Add("Programmer / Lead: Matt Nadareski (darksabre76)"); - helptext.Add("Additional code: emuLOAD, @tractivo, motoschifo"); - helptext.Add("Testing: emuLOAD, @tractivo, Kludge, Obiwantje, edc"); - helptext.Add("Suggestions: edc, AcidX, Amiga12, EliUmniCk"); - helptext.Add("Based on work by: The Wizard of DATz"); - break; - - default: - helptext.Add(Resources.Resources.Default_Desc); - break; - } - - // Now output based on the size of the screen - int i = 0; - foreach (string help in helptext) - { - Console.WriteLine(help); - i++; - - // If we're not being redirected and we reached the size of the screen, pause - if (i == Console.WindowHeight - 3) - { - i = 0; - Pause(); - } - } - Pause(); - } - - /// - /// Pause on console output - /// - private static void Pause() - { - if (!Console.IsOutputRedirected) - { - Console.WriteLine(); - Console.WriteLine("Press enter to continue..."); - Console.ReadLine(); - } - } } } diff --git a/SabreTools.Helper/Help/Help.cs b/SabreTools.Helper/Help/Help.cs index 282037ef..d8c457bf 100644 --- a/SabreTools.Helper/Help/Help.cs +++ b/SabreTools.Helper/Help/Help.cs @@ -9,6 +9,7 @@ namespace SabreTools.Helper.Help private List _header; private Dictionary _features; + private static string _barrier = "-----------------------------------------"; #endregion @@ -155,6 +156,24 @@ namespace SabreTools.Helper.Help WriteOutWithPauses(output); } + /// + /// Output the SabreTools suite credits + /// + public void OutputCredits() + { + List credits = new List(); + credits.Add(_barrier); + credits.Add("Credits"); + credits.Add(_barrier); + credits.Add(""); + credits.Add("Programmer / Lead: Matt Nadareski (darksabre76)"); + credits.Add("Additional code: emuLOAD, @tractivo, motoschifo"); + credits.Add("Testing: emuLOAD, @tractivo, Kludge, Obiwantje, edc"); + credits.Add("Suggestions: edc, AcidX, Amiga12, EliUmniCk"); + credits.Add("Based on work by: The Wizard of DATz"); + WriteOutWithPauses(credits); + } + /// /// Output a single feature recursively /// diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index 296f3cb2..f02567b1 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -45,7 +45,7 @@ namespace SabreTools // Credits take precidence over all if ((new List(args)).Contains("--credits")) { - Build.Help("Credits"); + _help.OutputCredits(); _logger.Close(); return; }