mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add No-Intro ID support
This commit is contained in:
@@ -763,6 +763,7 @@ namespace SabreTools.Core
|
||||
|
||||
Board,
|
||||
RebuildTo,
|
||||
NoIntroId,
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1120,6 +1120,12 @@ namespace SabreTools.Core.Tools
|
||||
case "rebuild_to":
|
||||
return MachineField.RebuildTo;
|
||||
|
||||
case "id":
|
||||
case "nointroid":
|
||||
case "nointro_id":
|
||||
case "no_intro_id":
|
||||
return MachineField.NoIntroId;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx EmuArc
|
||||
|
||||
@@ -410,6 +410,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
SourceFile = reader.GetAttribute("sourcefile"),
|
||||
Board = reader.GetAttribute("board"),
|
||||
RebuildTo = reader.GetAttribute("rebuildto"),
|
||||
NoIntroId = reader.GetAttribute("id"),
|
||||
Runnable = reader.GetAttribute("runnable").AsRunnable(), // Used by older DATs
|
||||
|
||||
CloneOf = reader.GetAttribute("cloneof"),
|
||||
@@ -950,6 +951,7 @@ namespace SabreTools.DatFiles.Formats
|
||||
xtw.WriteAttributeString("ismechanical", "yes");
|
||||
|
||||
xtw.WriteOptionalAttributeString("runnable", datItem.Machine.Runnable.FromRunnable());
|
||||
xtw.WriteOptionalAttributeString("id", datItem.Machine.NoIntroId);
|
||||
|
||||
if (!string.Equals(datItem.Machine.Name, datItem.Machine.CloneOf, StringComparison.OrdinalIgnoreCase))
|
||||
xtw.WriteOptionalAttributeString("cloneof", datItem.Machine.CloneOf);
|
||||
|
||||
@@ -367,6 +367,9 @@ namespace SabreTools.DatFiles
|
||||
if (MachineMappings.Keys.Contains(MachineField.RebuildTo))
|
||||
machine.RebuildTo = MachineMappings[MachineField.RebuildTo];
|
||||
|
||||
if (MachineMappings.Keys.Contains(MachineField.NoIntroId))
|
||||
machine.NoIntroId = MachineMappings[MachineField.NoIntroId];
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx EmuArc
|
||||
|
||||
@@ -201,6 +201,13 @@ namespace SabreTools.DatItems
|
||||
[XmlElement("rebuildto")]
|
||||
public string RebuildTo { get; set; } = null;
|
||||
|
||||
/// <summary>
|
||||
/// No-Intro ID for the game
|
||||
/// </summary>
|
||||
[JsonProperty("nointroid", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("nointroid")]
|
||||
public string NoIntroId { get; set; } = null;
|
||||
|
||||
#endregion
|
||||
|
||||
// TODO: Should this be a separate object for TruRip?
|
||||
@@ -387,6 +394,7 @@ namespace SabreTools.DatItems
|
||||
|
||||
Board = this.Board,
|
||||
RebuildTo = this.RebuildTo,
|
||||
NoIntroId = this.NoIntroId,
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -212,6 +212,9 @@ namespace SabreTools.Filtering
|
||||
if (MachineFields.Contains(MachineField.RebuildTo))
|
||||
machine.RebuildTo = null;
|
||||
|
||||
if (MachineFields.Contains(MachineField.NoIntroId))
|
||||
machine.NoIntroId = null;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx EmuArc
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace SabreTools.Filtering
|
||||
|
||||
public FilterItem<string> Board { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<string> RebuildTo { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<string> NoIntroId { get; private set; } = new FilterItem<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -255,6 +256,10 @@ namespace SabreTools.Filtering
|
||||
SetStringFilter(RebuildTo, value, negate);
|
||||
break;
|
||||
|
||||
case MachineField.NoIntroId:
|
||||
SetStringFilter(NoIntroId, value, negate);
|
||||
break;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx EmuArc
|
||||
@@ -456,6 +461,10 @@ namespace SabreTools.Filtering
|
||||
if (!PassStringFilter(RebuildTo, machine.RebuildTo))
|
||||
return false;
|
||||
|
||||
// Machine_NoIntroId
|
||||
if (!PassStringFilter(NoIntroId, machine.NoIntroId))
|
||||
return false;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx EmuArc
|
||||
|
||||
@@ -166,6 +166,9 @@ namespace SabreTools.Filtering
|
||||
if (machineFields.Contains(MachineField.RebuildTo))
|
||||
machine.RebuildTo = repMachine.RebuildTo;
|
||||
|
||||
if (machineFields.Contains(MachineField.NoIntroId))
|
||||
machine.NoIntroId = repMachine.NoIntroId;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Logiqx EmuArc
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</header>
|
||||
|
||||
<dir name="topdir">
|
||||
<machine name="game1" sourcefile="blah.c" board="newboard" rebuildto="game1" runnable="partial" cloneof="game2" romof="game2" sampleof="game2" isbios="yes" isdevice="no" ismechanical="yes">
|
||||
<machine name="game1" sourcefile="blah.c" board="newboard" rebuildto="game1" runnable="partial" cloneof="game2" romof="game2" sampleof="game2" isbios="yes" isdevice="no" ismechanical="yes" id="0001">
|
||||
<comment>Not a real game, sorry</comment>
|
||||
<description>Game! (Version 1)</description>
|
||||
<year>1980</year>
|
||||
|
||||
Reference in New Issue
Block a user