mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DATFromDir] Fix basic SuperDAT output
This commit is contained in:
@@ -432,7 +432,9 @@ namespace SabreTools
|
|||||||
if (!encounteredErrors)
|
if (!encounteredErrors)
|
||||||
{
|
{
|
||||||
_logger.Log(Path.GetFileName(item) + " treated like an archive");
|
_logger.Log(Path.GetFileName(item) + " treated like an archive");
|
||||||
foreach (string entry in Directory.EnumerateFiles(tempdir, "*", SearchOption.AllDirectories))
|
List<string> entries = Directory.EnumerateFiles(tempdir, "*", SearchOption.AllDirectories).ToList();
|
||||||
|
entries.Sort(Style.CompareNumeric);
|
||||||
|
foreach (string entry in entries)
|
||||||
{
|
{
|
||||||
string tempbasepath = (Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar);
|
string tempbasepath = (Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar);
|
||||||
lastparent = ProcessFile(Path.GetFullPath(entry), sw, Path.GetFullPath(tempdir),
|
lastparent = ProcessFile(Path.GetFullPath(entry), sw, Path.GetFullPath(tempdir),
|
||||||
|
|||||||
@@ -245,7 +245,9 @@ namespace SabreTools
|
|||||||
List<Rom> extracted = FileTools.GetArchiveFileInfo(item, _logger);
|
List<Rom> extracted = FileTools.GetArchiveFileInfo(item, _logger);
|
||||||
foreach (Rom rom in extracted)
|
foreach (Rom rom in extracted)
|
||||||
{
|
{
|
||||||
ProcessFileHelper(item, rom, _basePath,
|
ProcessFileHelper(item,
|
||||||
|
rom,
|
||||||
|
_basePath,
|
||||||
(Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, _basePath.Length) + Path.GetFileNameWithoutExtension(item));
|
(Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, _basePath.Length) + Path.GetFileNameWithoutExtension(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,7 +276,12 @@ namespace SabreTools
|
|||||||
new ParallelOptions { MaxDegreeOfParallelism = _maxDegreeOfParallelism },
|
new ParallelOptions { MaxDegreeOfParallelism = _maxDegreeOfParallelism },
|
||||||
entry =>
|
entry =>
|
||||||
{
|
{
|
||||||
ProcessFile(entry, tempSubDir, Path.GetFileNameWithoutExtension(item));
|
ProcessFile(entry,
|
||||||
|
tempSubDir,
|
||||||
|
Path.Combine((_datdata.Type == "SuperDAT"
|
||||||
|
? (Path.GetDirectoryName(Path.GetFullPath(item)) + Path.DirectorySeparatorChar).Remove(0, _basePath.Length)
|
||||||
|
: ""),
|
||||||
|
Path.GetFileNameWithoutExtension(item)));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Clear the temp directory
|
// Clear the temp directory
|
||||||
|
|||||||
@@ -2940,7 +2940,7 @@ namespace SabreTools.Helper
|
|||||||
"\t\t<homepage>" + HttpUtility.HtmlEncode(datdata.Homepage) + "</homepage>\n" +
|
"\t\t<homepage>" + HttpUtility.HtmlEncode(datdata.Homepage) + "</homepage>\n" +
|
||||||
"\t\t<url>" + HttpUtility.HtmlEncode(datdata.Url) + "</url>\n" +
|
"\t\t<url>" + HttpUtility.HtmlEncode(datdata.Url) + "</url>\n" +
|
||||||
"\t\t<comment>" + HttpUtility.HtmlEncode(datdata.Comment) + "</comment>\n" +
|
"\t\t<comment>" + HttpUtility.HtmlEncode(datdata.Comment) + "</comment>\n" +
|
||||||
(!String.IsNullOrEmpty(datdata.Type) ? "\t\t<type>" + datdata.Type + "</type>\n" : "") +
|
(!String.IsNullOrEmpty(datdata.Type) ? "\t\t<type>" + HttpUtility.HtmlEncode(datdata.Type) + "</type>\n" : "") +
|
||||||
(datdata.ForcePacking != ForcePacking.None || datdata.ForceMerging != ForceMerging.None || datdata.ForceNodump != ForceNodump.None ?
|
(datdata.ForcePacking != ForcePacking.None || datdata.ForceMerging != ForceMerging.None || datdata.ForceNodump != ForceNodump.None ?
|
||||||
"\t\t<clrmamepro" +
|
"\t\t<clrmamepro" +
|
||||||
(datdata.ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : "") +
|
(datdata.ForcePacking == ForcePacking.Unzip ? " forcepacking=\"unzip\"" : "") +
|
||||||
|
|||||||
Reference in New Issue
Block a user