mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFiles] Implement GameName prefixing
This commit is contained in:
@@ -898,7 +898,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
switch (rom.Type)
|
switch (rom.Type)
|
||||||
|
|||||||
@@ -544,28 +544,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
get { return _mergedBy; }
|
get { return _mergedBy; }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Data specific to the Miss DAT type
|
// Write pre-processing
|
||||||
public bool UseRomName
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_datHeader == null)
|
|
||||||
{
|
|
||||||
_datHeader = new DatHeader();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _datHeader.UseRomName;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_datHeader == null)
|
|
||||||
{
|
|
||||||
_datHeader = new DatHeader();
|
|
||||||
}
|
|
||||||
|
|
||||||
_datHeader.UseRomName = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public string Prefix
|
public string Prefix
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -608,6 +587,27 @@ namespace SabreTools.Library.DatFiles
|
|||||||
_datHeader.Postfix = value;
|
_datHeader.Postfix = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public bool GameName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_datHeader == null)
|
||||||
|
{
|
||||||
|
_datHeader = new DatHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _datHeader.GameName;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_datHeader == null)
|
||||||
|
{
|
||||||
|
_datHeader = new DatHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
_datHeader.GameName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
public bool Quotes
|
public bool Quotes
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -629,6 +629,29 @@ namespace SabreTools.Library.DatFiles
|
|||||||
_datHeader.Quotes = value;
|
_datHeader.Quotes = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Data specific to the Miss DAT type
|
||||||
|
public bool UseRomName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_datHeader == null)
|
||||||
|
{
|
||||||
|
_datHeader = new DatHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
return _datHeader.UseRomName;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (_datHeader == null)
|
||||||
|
{
|
||||||
|
_datHeader = new DatHeader();
|
||||||
|
}
|
||||||
|
|
||||||
|
_datHeader.UseRomName = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
public string ReplaceExtension
|
public string ReplaceExtension
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -692,27 +715,6 @@ namespace SabreTools.Library.DatFiles
|
|||||||
_datHeader.RemoveExtension = value;
|
_datHeader.RemoveExtension = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool GameName
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_datHeader == null)
|
|
||||||
{
|
|
||||||
_datHeader = new DatHeader();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _datHeader.GameName;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (_datHeader == null)
|
|
||||||
{
|
|
||||||
_datHeader = new DatHeader();
|
|
||||||
}
|
|
||||||
|
|
||||||
_datHeader.GameName = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public bool Romba
|
public bool Romba
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
switch (rom.Type)
|
switch (rom.Type)
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
switch (_hash)
|
switch (_hash)
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
switch (rom.Type)
|
switch (rom.Type)
|
||||||
|
|||||||
@@ -783,7 +783,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
switch (rom.Type)
|
switch (rom.Type)
|
||||||
|
|||||||
@@ -892,7 +892,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
switch (rom.Type)
|
switch (rom.Type)
|
||||||
|
|||||||
@@ -956,7 +956,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
state += "\t\t<game>\n"
|
state += "\t\t<game>\n"
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
if (rom.Type == ItemType.Rom)
|
if (rom.Type == ItemType.Rom)
|
||||||
|
|||||||
@@ -831,7 +831,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "", prefix = "";
|
string state = "", prefix = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
for (int i = 0; i < depth; i++)
|
for (int i = 0; i < depth; i++)
|
||||||
|
|||||||
@@ -787,7 +787,7 @@ namespace SabreTools.Library.DatFiles
|
|||||||
string state = "";
|
string state = "";
|
||||||
|
|
||||||
// Pre-process the item name
|
// Pre-process the item name
|
||||||
rom.Name = CreatePrefixPostfix(rom, true) + rom.Name + CreatePrefixPostfix(rom, false);
|
rom.Name = CreatePrefixPostfix(rom, true) + (GameName ? Path.Combine(rom.MachineName, rom.Name) : rom.Name) + CreatePrefixPostfix(rom, false);
|
||||||
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
rom.Name = rom.Name.Replace("\"", ""); // Quotes are not needed here
|
||||||
|
|
||||||
state += "\t\t<part name=\"" + rom.PartName + "\" interface=\"" + rom.PartInterface + "\">\n";
|
state += "\t\t<part name=\"" + rom.PartName + "\" interface=\"" + rom.PartInterface + "\">\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user