mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[Build, Help] Move credits to Help, remove last help from Build
This commit is contained in:
@@ -67,7 +67,7 @@ namespace RombaSharp
|
||||
// Credits take precidence over all
|
||||
if ((new List<string>(args)).Contains("--credits"))
|
||||
{
|
||||
Build.Help("Credits");
|
||||
_help.OutputCredits();
|
||||
_logger.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SabreTools.Helper.Data
|
||||
{
|
||||
@@ -56,71 +55,5 @@ namespace SabreTools.Helper.Data
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show the help dialog for a given class
|
||||
/// </summary>
|
||||
/// <param name="className">Name of the class to get help for, "Credits" for developer credits</param>
|
||||
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<string> helptext = new List<string>();
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pause on console output
|
||||
/// </summary>
|
||||
private static void Pause()
|
||||
{
|
||||
if (!Console.IsOutputRedirected)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Press enter to continue...");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace SabreTools.Helper.Help
|
||||
|
||||
private List<string> _header;
|
||||
private Dictionary<string, Feature> _features;
|
||||
private static string _barrier = "-----------------------------------------";
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -155,6 +156,24 @@ namespace SabreTools.Helper.Help
|
||||
WriteOutWithPauses(output);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Output the SabreTools suite credits
|
||||
/// </summary>
|
||||
public void OutputCredits()
|
||||
{
|
||||
List<string> credits = new List<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Output a single feature recursively
|
||||
/// </summary>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace SabreTools
|
||||
// Credits take precidence over all
|
||||
if ((new List<string>(args)).Contains("--credits"))
|
||||
{
|
||||
Build.Help("Credits");
|
||||
_help.OutputCredits();
|
||||
_logger.Close();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user