mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Properly implement SuperDAT functionality
This commit is contained in:
@@ -217,24 +217,6 @@ namespace SabreTools
|
|||||||
// Create an output dictionary for all found items
|
// Create an output dictionary for all found items
|
||||||
_dict = new Dictionary<string, List<RomData>>();
|
_dict = new Dictionary<string, List<RomData>>();
|
||||||
|
|
||||||
/*
|
|
||||||
For clarity, here is the process for SuperDAT:
|
|
||||||
1) Check to see if the input is a directory
|
|
||||||
2) If it is, loop through and get ONLY the directories
|
|
||||||
3) Treat each subdirectory like a base path
|
|
||||||
4) Process each subdirectory like a normal one
|
|
||||||
5) Prefix any added game names with the parent directory name
|
|
||||||
6) Process like normal
|
|
||||||
*/
|
|
||||||
|
|
||||||
// If we're in SuperDAT mode, we have to treat it separately
|
|
||||||
if (_superDat)
|
|
||||||
{
|
|
||||||
_logger.Error("SuperDAT functionality not implemented yet!");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Loop over each of the found paths, if any
|
// Loop over each of the found paths, if any
|
||||||
foreach (string path in _inputs)
|
foreach (string path in _inputs)
|
||||||
{
|
{
|
||||||
@@ -280,7 +262,6 @@ namespace SabreTools
|
|||||||
_logger.Error(path + " is not a valid input!");
|
_logger.Error(path + " is not a valid input!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// If we found nothing (error state), exit
|
// If we found nothing (error state), exit
|
||||||
if (_dict.Count == 0)
|
if (_dict.Count == 0)
|
||||||
@@ -305,6 +286,26 @@ namespace SabreTools
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
_name = (_name == "" ? "Default" : _name);
|
_name = (_name == "" ? "Default" : _name);
|
||||||
|
|
||||||
|
// If we're in a superdat, append the folder name to all game names
|
||||||
|
if (_superDat)
|
||||||
|
{
|
||||||
|
List<string> keys = _dict.Keys.ToList();
|
||||||
|
foreach (string key in keys)
|
||||||
|
{
|
||||||
|
List<RomData> newroms = new List<RomData>();
|
||||||
|
foreach (RomData rom in _dict[key])
|
||||||
|
{
|
||||||
|
RomData newrom = rom;
|
||||||
|
newrom.Game = _name + Path.DirectorySeparatorChar + newrom.Game;
|
||||||
|
newroms.Add(newrom);
|
||||||
|
}
|
||||||
|
_dict[key] = newroms;
|
||||||
|
}
|
||||||
|
|
||||||
|
_name = _name += " - SuperDAT";
|
||||||
|
}
|
||||||
|
|
||||||
_desc = (_desc == "" ? _name + (_bare ? "" : " (" + _date + ")") : _desc);
|
_desc = (_desc == "" ? _name + (_bare ? "" : " (" + _date + ")") : _desc);
|
||||||
|
|
||||||
DatData datdata = new DatData
|
DatData datdata = new DatData
|
||||||
|
|||||||
Reference in New Issue
Block a user