mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix GAME prefix not DAT prefix
This commit is contained in:
@@ -139,10 +139,10 @@ namespace SabreTools.Helper
|
||||
/// <param name="quotes">True if quotes should be put around the item, false otherwise (default)</param>
|
||||
/// <param name="addext">Arbitrary extension added to the end of each item</param>
|
||||
/// <param name="repext">Arbitrary extension to replace all extensions in the item</param>
|
||||
/// <param name="datname">The internal name of the DAT to prefix</param>
|
||||
/// <param name="gamename">True if the game name is appended (only when !usegame), false otherwise</param>
|
||||
/// <returns>True if the file was written, false otherwise</returns>
|
||||
public static bool WriteToText(string textfile, string outdir, List<RomData> roms, Logger logger, bool useGame = true, string prefix = "",
|
||||
string postfix = "", string addext = "", string repext = "", bool quotes = false, string datname = "")
|
||||
string postfix = "", string addext = "", string repext = "", bool quotes = false, bool gamename = false)
|
||||
{
|
||||
// Normalize the output directory
|
||||
if (outdir == "")
|
||||
@@ -154,12 +154,6 @@ namespace SabreTools.Helper
|
||||
outdir += Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
// Get the DAT name, if applicable
|
||||
if (datname != "" && !datname.EndsWith(Path.DirectorySeparatorChar.ToString()))
|
||||
{
|
||||
datname = datname + Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
// Make the output directory if it doesn't exist
|
||||
if (!Directory.Exists(outdir))
|
||||
{
|
||||
@@ -182,7 +176,7 @@ namespace SabreTools.Helper
|
||||
{
|
||||
string pre = prefix + (quotes ? "\"" : "");
|
||||
string post = (quotes ? "\"" : "") + postfix;
|
||||
string name = datname + (useGame ? rom.Game : rom.Name);
|
||||
string name = (useGame ? rom.Game : rom.Name);
|
||||
if (repext != "")
|
||||
{
|
||||
string dir = Path.GetDirectoryName(name);
|
||||
@@ -194,6 +188,10 @@ namespace SabreTools.Helper
|
||||
{
|
||||
name += addext;
|
||||
}
|
||||
if (!useGame && gamename)
|
||||
{
|
||||
name = (rom.Game.EndsWith(Path.DirectorySeparatorChar.ToString()) ? rom.Game : rom.Game + Path.DirectorySeparatorChar) + name;
|
||||
}
|
||||
|
||||
if (useGame && rom.Game != lastgame)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user