[DatTools] Fix filter issue, rename file to match class

This commit is contained in:
Matt Nadareski
2016-06-11 20:31:00 -07:00
parent 6ea7108f17
commit e02233e5d4
4 changed files with 12 additions and 9 deletions

View File

@@ -52,7 +52,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<OutputPath>..\..\Debug-x64\</OutputPath> <OutputPath>..\..\Debug-x64\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>

View File

@@ -1710,17 +1710,17 @@ namespace SabreTools.Helper
string romtype, long sgt, long slt, long seq, string crc, string md5, string sha1, bool? nodump, Logger logger) string romtype, long sgt, long slt, long seq, string crc, string md5, string sha1, bool? nodump, Logger logger)
{ {
// Clean the input strings // Clean the input strings
outputDirectory = outputDirectory.Replace("\"", "");
if (outputDirectory != "")
{
outputDirectory = Path.GetFullPath(outputDirectory) + Path.DirectorySeparatorChar;
}
inputFileName = inputFileName.Replace("\"", ""); inputFileName = inputFileName.Replace("\"", "");
if (inputFileName != "")
{
inputFileName = Path.GetFullPath(inputFileName);
}
outputDirectory = outputDirectory.Replace("\"", "");
if (File.Exists(inputFileName)) if (File.Exists(inputFileName))
{ {
logger.User("Processing \"" + Path.GetFileName(inputFileName) + "\""); logger.User("Processing \"" + Path.GetFileName(inputFileName) + "\"");
datdata = DatTools.Parse(inputFileName, 0, 0, datdata, logger, true, clean); datdata = Parse(inputFileName, 0, 0, datdata, logger, true, clean);
datdata = Filter(datdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, logger); datdata = Filter(datdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, logger);
// If the extension matches, append ".new" to the filename // If the extension matches, append ".new" to the filename
@@ -1741,7 +1741,7 @@ namespace SabreTools.Helper
logger.User("Processing \"" + Path.GetFullPath(file).Remove(0, inputFileName.Length) + "\""); logger.User("Processing \"" + Path.GetFullPath(file).Remove(0, inputFileName.Length) + "\"");
DatData innerDatdata = (DatData)datdata.Clone(); DatData innerDatdata = (DatData)datdata.Clone();
innerDatdata.Roms = null; innerDatdata.Roms = null;
innerDatdata = DatTools.Parse(file, 0, 0, innerDatdata, logger, true, clean); innerDatdata = Parse(file, 0, 0, innerDatdata, logger, true, clean);
innerDatdata = Filter(innerDatdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, logger); innerDatdata = Filter(innerDatdata, gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, nodump, logger);
// If the extension matches, append ".new" to the filename // If the extension matches, append ".new" to the filename
@@ -1922,6 +1922,9 @@ namespace SabreTools.Helper
datdata.Roms[key] = null; datdata.Roms[key] = null;
} }
// Resassign the new dictionary to the DatData object
datdata.Roms = dict;
return datdata; return datdata;
} }
} }

View File

@@ -100,7 +100,7 @@
<Compile Include="DatTools\Output.cs" /> <Compile Include="DatTools\Output.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Remapping.cs" /> <Compile Include="Remapping.cs" />
<Compile Include="DatTools\RomManipulation.cs" /> <Compile Include="DatTools\DatTools.cs" />
<Compile Include="Data\Structs.cs" /> <Compile Include="Data\Structs.cs" />
<Compile Include="DatTools\Stats.cs" /> <Compile Include="DatTools\Stats.cs" />
<Compile Include="DatTools\Style.cs" /> <Compile Include="DatTools\Style.cs" />

Binary file not shown.