[DatFile] Logiqx DATs don't like these fields to be equal

This commit is contained in:
Matt Nadareski
2016-10-01 13:12:10 -07:00
parent ae5269bbbd
commit f0977490aa

View File

@@ -4586,6 +4586,24 @@ namespace SabreTools.Helper
case OutputFormat.DOSCenter: case OutputFormat.DOSCenter:
state += "game (\n\tname \"" + rom.MachineName + ".zip\"\n"; state += "game (\n\tname \"" + rom.MachineName + ".zip\"\n";
break; break;
case OutputFormat.Logiqx:
state += "\t<machine name=\"" + HttpUtility.HtmlEncode(rom.MachineName) + "\"" +
(rom.IsBios ? " isbios=\"yes\"" : "") +
(String.IsNullOrEmpty(rom.CloneOf) || (rom.MachineName.ToLowerInvariant() == rom.CloneOf.ToLowerInvariant())
? ""
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.CloneOf) + "\"") +
(String.IsNullOrEmpty(rom.RomOf) || (rom.MachineName.ToLowerInvariant() == rom.RomOf.ToLowerInvariant())
? ""
: " romof=\"" + HttpUtility.HtmlEncode(rom.RomOf) + "\"") +
(String.IsNullOrEmpty(rom.SampleOf) || (rom.MachineName.ToLowerInvariant() == rom.SampleOf.ToLowerInvariant())
? ""
: " sampleof=\"" + HttpUtility.HtmlEncode(rom.SampleOf) + "\"") +
">\n" +
(String.IsNullOrEmpty(rom.Comment) ? "" : "\t\t<comment>" + HttpUtility.HtmlEncode(rom.Comment) + "</comment>\n") +
"\t\t<description>" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) + "</description>\n" +
(String.IsNullOrEmpty(rom.Year) ? "" : "\t\t<year>" + HttpUtility.HtmlEncode(rom.Year) + "</year>\n") +
(String.IsNullOrEmpty(rom.Manufacturer) ? "" : "\t\t<manufacturer>" + HttpUtility.HtmlEncode(rom.Manufacturer) + "</manufacturer>\n");
break;
case OutputFormat.SabreDat: case OutputFormat.SabreDat:
for (int i = (last == -1 ? 0 : last); i < newsplit.Count; i++) for (int i = (last == -1 ? 0 : last); i < newsplit.Count; i++)
{ {
@@ -4617,18 +4635,6 @@ namespace SabreTools.Helper
state += "\t\t\t<feature name=\"" + kvp.Key + "\" value=\"" + kvp.Value + "\">\n"; state += "\t\t\t<feature name=\"" + kvp.Key + "\" value=\"" + kvp.Value + "\">\n";
} }
break; break;
case OutputFormat.Logiqx:
state += "\t<machine name=\"" + HttpUtility.HtmlEncode(rom.MachineName) + "\"" +
(rom.IsBios ? " isbios=\"yes\"" : "") +
(String.IsNullOrEmpty(rom.CloneOf) ? "" : " cloneof=\"" + HttpUtility.HtmlEncode(rom.CloneOf) + "\"") +
(String.IsNullOrEmpty(rom.RomOf) ? "" : " romof=\"" + HttpUtility.HtmlEncode(rom.RomOf) + "\"") +
(String.IsNullOrEmpty(rom.SampleOf) ? "" : " sampleof=\"" + HttpUtility.HtmlEncode(rom.SampleOf) + "\"") +
">\n" +
(String.IsNullOrEmpty(rom.Comment) ? "" : "\t\t<comment>" + HttpUtility.HtmlEncode(rom.Comment) + "</comment>\n") +
"\t\t<description>" + HttpUtility.HtmlEncode((String.IsNullOrEmpty(rom.MachineDescription) ? rom.MachineName : rom.MachineDescription)) + "</description>\n" +
(String.IsNullOrEmpty(rom.Year) ? "" : "\t\t<year>" + HttpUtility.HtmlEncode(rom.Year) + "</year>\n") +
(String.IsNullOrEmpty(rom.Manufacturer) ? "" : "\t\t<manufacturer>" + HttpUtility.HtmlEncode(rom.Manufacturer) + "</manufacturer>\n");
break;
} }
sw.Write(state); sw.Write(state);