Update menus, part 1

This commit is contained in:
Matt Nadareski
2016-04-20 00:01:58 -07:00
parent d036092d8f
commit f09b63c4d1
2 changed files with 81 additions and 94 deletions

View File

@@ -268,15 +268,13 @@ Make a selection:
1) Show command line usage
2) Import a DAT file or folder
3) Generate a DAT file
4) Generate all DAT files
5) Convert a DAT file from RV to XML
6) Convert a DAT file from XML to RV
7) List all available sources
8) List all available systems
9) Add and remove systems and sources
10) " + (logger.ToFile ? "Disable Logging" : "Enable Logging") + @"
11) Show credits
3) Generate DAT files
4) DAT file tools
5) List all available sources
6) List all available systems
7) Add and remove systems and sources
8) " + (logger.ToFile ? "Disable Logging" : "Enable Logging") + @"
9) Show credits
X) Exit Program
");
Console.Write("Enter selection: ");
@@ -294,35 +292,29 @@ Make a selection:
GenerateMenu();
break;
case "4":
GenerateAllMenu();
DatToolsMenu();
break;
case "5":
ConvertXMLMenu();
break;
case "6":
ConvertRVMenu();
break;
case "7":
Console.Clear();
Build.Start("DATabase");
ListSources();
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;
case "8":
case "6":
Console.Clear();
Build.Start("DATabase");
ListSystems();
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;
case "9":
case "7":
AddRemoveMenu();
break;
case "10":
case "8":
logger.ToFile = !logger.ToFile;
break;
case "11":
case "9":
Console.Clear();
Build.Credits();
Console.Write("\nPress any key to continue...");
@@ -414,10 +406,11 @@ Make a selection:
1) " + (norename ? "Enable game renaming" : "Disable game renaming") + @"
2) " + (old ? "Enable XML output" : "Enable RomVault output") + @"
3) Enter a list of systems to generate from
4) Enter a list of sources to generate from
5) Enter an output folder
3) List of systems to generate from" + (systems != "" ? ": " + systems : "") + @"
4) List of sources to generate from" + (sources != "" ? ": " + sources : "") + @"
5) Enter an output folder" + (outdir != "" ? ":\n\t" + outdir : "") + @"
6) Generate the DAT file
7) Generate all available DAT files
B) Go back to the previous menu
");
Console.Write("Enter selection: ");
@@ -453,6 +446,12 @@ Make a selection:
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;
case "7":
Console.Clear();
InitGenerateAll(outdir, norename, old);
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;
}
}
return;
@@ -472,53 +471,6 @@ Make a selection:
return;
}
/// <summary>
/// Show the text-based generate all menu
/// </summary>
private static void GenerateAllMenu()
{
string selection = "", outdir = "";
bool norename = false, old = false;
while (selection.ToLowerInvariant() != "b")
{
Console.Clear();
Build.Start("DATabase");
Console.WriteLine(@"GENERATE ALL MENU
===========================
Make a selection:
1) " + (norename ? "Enable game renaming" : "Disable game renaming") + @"
2) " + (old ? "Enable XML output" : "Enable RomVault output") + @"
3) Enter an output folder
4) Generate all DAT files
B) Go back to the previous menu
");
Console.Write("Enter selection: ");
selection = Console.ReadLine();
switch (selection)
{
case "1":
norename = !norename;
break;
case "2":
old = !old;
break;
case "3":
Console.Clear();
Console.Write("Please enter a folder name: ");
outdir = Console.ReadLine();
break;
case "4":
Console.Clear();
InitGenerateAll(outdir, norename, old);
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;
}
}
return;
}
/// <summary>
/// Wrap generating all standard DATs from the database
/// </summary>
@@ -635,6 +587,46 @@ Make a selection:
return;
}
/// <summary>
/// Show the text-based DAT tools menu
/// </summary>
/// <remarks>
/// At an unspecified future date, this will also include the following currently-separate programs:
/// - DatSplit
/// - SingleGame
/// - MergeDAT
/// - DATFromDir
/// - DatToMiss
/// </remarks>
private static void DatToolsMenu()
{
string selection = "";
while (selection.ToLowerInvariant() != "b")
{
Console.Clear();
Build.Start("DATabase");
Console.WriteLine(@"DAT TOOLS MENU
===========================
Make a selection:
1) Convert XML DAT to RV
2) Convert RV DAT to XML
B) Go back to the previous menu
");
Console.Write("Enter selection: ");
selection = Console.ReadLine();
switch (selection)
{
case "1":
ConvertRVMenu();
break;
case "2":
ConvertXMLMenu();
break;
}
}
}
/// <summary>
/// Show the text-based XML to RV conversion menu
/// </summary>

View File

@@ -70,42 +70,37 @@ namespace SabreTools.Helper
Console.Write(@"
DATabase - Import and Generate DAT files
-----------------------------------------
Usage: DATabase [option] [filename|dirname|<system=sy,...> <source=so,...>]
Usage: DATabase [option] [filename|dirname] <filename|dirname> ...
Options:
-h, -?, --help Show this help
-i, --import Start tool in import mode
A filename or folder is required to run
-g, --generate Start tool in generate mode
system=sy,... List of system IDs
source=so,... List of source IDs
out=dir Output directory
-nr, --no-rename Don't auto-rename games
-old, --romvault Produce a DAT in RV format
-ga, --generate-all Start tool in generate all mode
-lso, --list-sources List all sources (id <= name)
-lsy, --list-systems List all systems (id <= name)
-cr, --convert-rv Convert an XML DAT to RV
-cx, --convert-xml Convert a RV DAT to XML
Both converters require a filename or folder
-l, --log Enable logging of program output
");
Console.Write("\nPress any key to continue...");
Console.ReadKey();
Console.Write(@"
Database Options:
-?, -h, --help Show this help
-a, --add Add a new system or source to the database
manu=mn Manufacturer name (system only)
system=sy System name (system only)
source=sr Source name (source only)
url=ul URL (source only)
-cr, --convert-rv Convert an XML DAT to RV
-cx, --convert-xml Convert a RV DAT to XML
Both converters require a filename or folder
-g, --generate Start tool in generate mode
-ga, --generate-all Start tool in generate all mode
system=sy,... List of system IDs
source=so,... List of source IDs
out=dir Output directory
-nr, --no-rename Don't auto-rename games
-old, --romvault Produce a DAT in RV format
-i, --import Start tool in import mode
A filename or folder is required to run
-l, --log Enable logging of program output
-lso, --list-sources List all sources (id <= name)
-lsy, --list-systems List all systems (id <= name)
-r, --remove Remove a system or source from the database
system=sy System ID
source=so Source ID
Filenames and directories can't start with '-', 'system=', or 'source='
unless prefixed by 'input='");
unless prefixed by 'input='
");
Console.Write("\nPress any key to continue...");
Console.ReadKey();
break;