From 0243574542113b4ec241448a4e60711077ce7920 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 20 Apr 2016 01:27:15 -0700 Subject: [PATCH] Merge SingleGame, part 4 --- DATabase/DATabase.cs | 34 +++++++------- DATabase/SingleGame.cs | 5 +-- SabreHelper/Build.cs | 4 +- SingleGame/App.config | 6 --- SingleGame/Properties/AssemblyInfo.cs | 36 --------------- SingleGame/SingleGame.csproj | 65 --------------------------- 6 files changed, 21 insertions(+), 129 deletions(-) delete mode 100644 SingleGame/App.config delete mode 100644 SingleGame/Properties/AssemblyInfo.cs delete mode 100644 SingleGame/SingleGame.csproj diff --git a/DATabase/DATabase.cs b/DATabase/DATabase.cs index 18d2d8cb..68acd800 100644 --- a/DATabase/DATabase.cs +++ b/DATabase/DATabase.cs @@ -63,7 +63,7 @@ namespace SabreTools norename = false, old = false, rem = false, - single = false, + trim = false, skip = false; string manu = "", outdir = "", @@ -135,13 +135,13 @@ namespace SabreTools case "--remove": rem = true; break; - case "-sg": - case "--single-game": - single = true; - break; case "--skip": skip = true; break; + case "-tm": + case "--trim-merge": + trim = true; + break; default: if (arg.StartsWith("input=")) { @@ -186,7 +186,7 @@ namespace SabreTools } // If more than one switch is enabled or help is set, show the help screen - if (help || !(add ^ convertRV ^ convertXml ^ generate ^ genall ^ import ^ listsrc ^ listsys ^ rem ^ single)) + if (help || !(add ^ convertRV ^ convertXml ^ generate ^ genall ^ import ^ listsrc ^ listsys ^ rem ^ trim)) { Build.Help(); logger.Close(); @@ -194,7 +194,7 @@ namespace SabreTools } // If a switch that requires a filename is set and no file is, show the help screen - if (inputs.Count == 0 && (convertRV || convertXml || import || single)) + if (inputs.Count == 0 && (convertRV || convertXml || import || trim)) { Build.Help(); logger.Close(); @@ -292,11 +292,11 @@ namespace SabreTools } // Consolodate and trim DAT - else if (single) + else if (trim) { foreach (string input in inputs) { - InitSingleGame(input, root, !norename, !disableForce); + InitTrimMerge(input, root, !norename, !disableForce); } } @@ -677,7 +677,7 @@ Make a selection: ConvertXMLMenu(); break; case "3": - SingleGameMenu(); + TrimMergeMenu(); break; } } @@ -797,9 +797,9 @@ or 'b' to go back to the previous menu: } /// - /// Show the text-based SingleGame menu + /// Show the text-based TrimMerge menu /// - private static void SingleGameMenu() + private static void TrimMergeMenu() { string selection = "", input = "", root = ""; bool forceunzip = true, rename = true; @@ -807,7 +807,7 @@ or 'b' to go back to the previous menu: { Console.Clear(); Build.Start("DATabase"); - Console.WriteLine(@"SINGLE GAME MENU + Console.WriteLine(@"DAT TRIM MENU =========================== Make a selection: @@ -815,7 +815,7 @@ Make a selection: 2) Root folder for reference" + (root != "" ? ":\n\t" + root : "") + @" 3) " + (forceunzip ? "Remove 'forcepacking=\"unzip\"' from output" : "Add 'forcepacking=\"unzip\"' to output") + @" 4) " + (rename ? "Disable game renaming" : "Enable game renaming") + @" - 5) Process the DAT + 5) Process the file or folder B) Go back to the previous menu "); Console.Write("Enter selection: "); @@ -840,7 +840,7 @@ Make a selection: break; case "5": Console.Clear(); - InitSingleGame(input, root, rename, forceunzip); + InitTrimMerge(input, root, rename, forceunzip); Console.Write("\nPress any key to continue..."); Console.ReadKey(); break; @@ -855,14 +855,14 @@ Make a selection: /// Root directory to base path lengths on /// True is games should not be renamed /// True if forcepacking="unzip" should be included - private static void InitSingleGame(string input, string root, bool rename, bool force) + private static void InitTrimMerge(string input, string root, bool rename, bool force) { // Strip any quotations from the name input = input.Replace("\"", ""); if (input != "" && File.Exists(input) || Directory.Exists(input)) { - SingleGame sg = new SingleGame(input, root, rename, force, logger); + TrimMerge sg = new TrimMerge(input, root, rename, force, logger); sg.Process(); return; } diff --git a/DATabase/SingleGame.cs b/DATabase/SingleGame.cs index 9cbc5ec5..f1edd689 100644 --- a/DATabase/SingleGame.cs +++ b/DATabase/SingleGame.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; using System.IO; -using System.Xml; using SabreTools.Helper; namespace SabreTools { - public class SingleGame + public class TrimMerge { // Instance variables private static string _filename = ""; @@ -24,7 +23,7 @@ namespace SabreTools /// True if games should be renamed into a uniform string, false otherwise /// True if forcepacking="unzip" should be set on the output, false otherwise /// Logger object for console and file output - public SingleGame(string filename, string path, bool rename, bool forceunpack, Logger logger) + public TrimMerge(string filename, string path, bool rename, bool forceunpack, Logger logger) { _filename = filename; _path = path; diff --git a/SabreHelper/Build.cs b/SabreHelper/Build.cs index 2ff94620..1b04bcdc 100644 --- a/SabreHelper/Build.cs +++ b/SabreHelper/Build.cs @@ -97,12 +97,12 @@ Options: -r, --remove Remove a system or source from the database system= System ID source= Source ID - -sg, --single-game Consolidate DAT into a single game and trim entries + -tm, --trim-merge Consolidate DAT into a single game and trim entries -rd=, --root-dir= Set the directory name for path size -nr, --no-rename Disable single-game mode -df, --disable-force Disable forceunzipping -Filenames and directories can't start with '-', 'system=', or 'source=' +Filenames and directories can't start with a reserved string unless prefixed by 'input=' "); Console.Write("\nPress any key to continue..."); diff --git a/SingleGame/App.config b/SingleGame/App.config deleted file mode 100644 index 88fa4027..00000000 --- a/SingleGame/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/SingleGame/Properties/AssemblyInfo.cs b/SingleGame/Properties/AssemblyInfo.cs deleted file mode 100644 index f76bc5ff..00000000 --- a/SingleGame/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SingleGame")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SingleGame")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("07eb8ea7-303a-407f-a881-060ed4595d7f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SingleGame/SingleGame.csproj b/SingleGame/SingleGame.csproj deleted file mode 100644 index b5d3a10c..00000000 --- a/SingleGame/SingleGame.csproj +++ /dev/null @@ -1,65 +0,0 @@ - - - - - Debug - AnyCPU - {07EB8EA7-303A-407F-A881-060ED4595D7F} - Exe - Properties - SingleGame - SingleGame - v4.5.2 - 512 - true - - - AnyCPU - true - full - false - ..\..\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - ..\..\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - {225a1afd-0890-44e8-b779-7502665c23a5} - SabreHelper - - - - - \ No newline at end of file