mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Make runnable flag better
This commit is contained in:
@@ -19,7 +19,7 @@ namespace SabreTools.Helper.Dats
|
||||
protected string _cloneOf;
|
||||
protected string _sampleOf;
|
||||
protected string _sourceFile;
|
||||
protected bool _runnable;
|
||||
protected bool? _runnable;
|
||||
protected string _board;
|
||||
protected string _rebuildTo;
|
||||
protected List<string> _devices;
|
||||
@@ -75,7 +75,7 @@ namespace SabreTools.Helper.Dats
|
||||
get { return _sourceFile; }
|
||||
set { _sourceFile = value; }
|
||||
}
|
||||
public bool Runnable
|
||||
public bool? Runnable
|
||||
{
|
||||
get { return _runnable; }
|
||||
set { _runnable = value; }
|
||||
@@ -112,7 +112,7 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
_name = "";
|
||||
_description = "";
|
||||
_runnable = true;
|
||||
_runnable = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -124,7 +124,7 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
_name = name;
|
||||
_description = description;
|
||||
_runnable = true;
|
||||
_runnable = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -437,7 +437,6 @@ namespace SabreTools.Helper.Dats
|
||||
{
|
||||
Name = gamename,
|
||||
Description = gamename,
|
||||
Runnable = false,
|
||||
};
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1274,7 +1274,6 @@ namespace SabreTools.Helper.Dats
|
||||
xtr.GetAttribute("isdevice") == "yes" ? MachineType.Device :
|
||||
xtr.GetAttribute("ismechanical") == "yes" ? MachineType.Mechanical :
|
||||
MachineType.None,
|
||||
Runnable = xtr.GetAttribute("runnable") == "yes" || xtr.GetAttribute("runnable") == null,
|
||||
};
|
||||
|
||||
// Get the supported value from the reader
|
||||
@@ -1291,6 +1290,20 @@ namespace SabreTools.Helper.Dats
|
||||
}
|
||||
}
|
||||
|
||||
// Get the runnable value from the reader
|
||||
if (subreader.GetAttribute("runnable") != null)
|
||||
{
|
||||
switch (subreader.GetAttribute("runnable"))
|
||||
{
|
||||
case "no":
|
||||
machine.Runnable = false;
|
||||
break;
|
||||
case "yes":
|
||||
machine.Runnable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (superdat && !keep)
|
||||
{
|
||||
string tempout = Regex.Match(machine.Name, @".*?\\(.*)").Groups[1].Value;
|
||||
|
||||
@@ -488,7 +488,7 @@ namespace SabreTools.Helper.Dats
|
||||
(rom.Machine.MachineType == MachineType.Bios ? " isbios=\"yes\"" : "") +
|
||||
(rom.Machine.MachineType == MachineType.Device ? " isdevice=\"yes\"" : "") +
|
||||
(rom.Machine.MachineType == MachineType.Mechanical ? " ismechanical=\"yes\"" : "") +
|
||||
(rom.Machine.Runnable ? " runnable=\"yes\"" : "") +
|
||||
(rom.Machine.Runnable == true ? " runnable=\"yes\"" : "") +
|
||||
(String.IsNullOrEmpty(rom.Machine.CloneOf) || (rom.Machine.Name.ToLowerInvariant() == rom.Machine.CloneOf.ToLowerInvariant())
|
||||
? ""
|
||||
: " cloneof=\"" + HttpUtility.HtmlEncode(rom.Machine.CloneOf) + "\"") +
|
||||
|
||||
Reference in New Issue
Block a user