mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Update Driver with new fields
This commit is contained in:
@@ -652,6 +652,10 @@ namespace SabreTools.Core
|
||||
EmulationStatus,
|
||||
CocktailStatus,
|
||||
SaveStateStatus,
|
||||
RequiresArtwork,
|
||||
Unofficial,
|
||||
NoSoundHardware,
|
||||
Incomplete,
|
||||
|
||||
// Extension
|
||||
Extension_Name,
|
||||
|
||||
@@ -665,6 +665,18 @@ namespace SabreTools.Core.Tools
|
||||
case "savestatestatus":
|
||||
return DatItemField.SaveStateStatus;
|
||||
|
||||
case "requiresartwork":
|
||||
return DatItemField.RequiresArtwork;
|
||||
|
||||
case "unofficial":
|
||||
return DatItemField.Unofficial;
|
||||
|
||||
case "nosoundhardware":
|
||||
return DatItemField.NoSoundHardware;
|
||||
|
||||
case "incomplete":
|
||||
return DatItemField.Incomplete;
|
||||
|
||||
// Extension
|
||||
case "extension_name":
|
||||
return DatItemField.Extension_Name;
|
||||
|
||||
@@ -569,6 +569,10 @@ namespace SabreTools.DatFiles.Formats
|
||||
Emulation = reader.GetAttribute("emulation").AsSupportStatus(),
|
||||
Cocktail = reader.GetAttribute("cocktail").AsSupportStatus(),
|
||||
SaveState = reader.GetAttribute("savestate").AsSupported(),
|
||||
RequiresArtwork = reader.GetAttribute("requiresartwork").AsYesNo(),
|
||||
Unofficial = reader.GetAttribute("unofficial").AsYesNo(),
|
||||
NoSoundHardware = reader.GetAttribute("nosoundhardware").AsYesNo(),
|
||||
Incomplete = reader.GetAttribute("incomplete").AsYesNo(),
|
||||
|
||||
Source = new Source
|
||||
{
|
||||
@@ -1592,6 +1596,18 @@ namespace SabreTools.DatFiles.Formats
|
||||
xtw.WriteRequiredAttributeString("name", setting.Name);
|
||||
xtw.WriteRequiredAttributeString("value", setting.Value);
|
||||
xtw.WriteOptionalAttributeString("default", setting.Default.FromYesNo());
|
||||
if (setting.ConditionsSpecified)
|
||||
{
|
||||
foreach (var confsettingCondition in setting.Conditions)
|
||||
{
|
||||
xtw.WriteStartElement("condition");
|
||||
xtw.WriteRequiredAttributeString("tag", confsettingCondition.Tag);
|
||||
xtw.WriteRequiredAttributeString("mask", confsettingCondition.Mask);
|
||||
xtw.WriteRequiredAttributeString("relation", confsettingCondition.Relation.FromRelation());
|
||||
xtw.WriteRequiredAttributeString("value", confsettingCondition.Value);
|
||||
xtw.WriteEndElement();
|
||||
}
|
||||
}
|
||||
xtw.WriteEndElement();
|
||||
}
|
||||
}
|
||||
@@ -1731,6 +1747,10 @@ namespace SabreTools.DatFiles.Formats
|
||||
xtw.WriteRequiredAttributeString("emulation", driver.Emulation.FromSupportStatus());
|
||||
xtw.WriteOptionalAttributeString("cocktail", driver.Cocktail.FromSupportStatus());
|
||||
xtw.WriteRequiredAttributeString("savestate", driver.SaveState.FromSupported(true));
|
||||
xtw.WriteOptionalAttributeString("requiresartwork", driver.RequiresArtwork.FromYesNo());
|
||||
xtw.WriteOptionalAttributeString("unofficial", driver.Unofficial.FromYesNo());
|
||||
xtw.WriteOptionalAttributeString("nosoundhardware", driver.NoSoundHardware.FromYesNo());
|
||||
xtw.WriteOptionalAttributeString("incomplete", driver.Incomplete.FromYesNo());
|
||||
xtw.WriteEndElement();
|
||||
break;
|
||||
|
||||
|
||||
@@ -826,6 +826,18 @@ namespace SabreTools.DatFiles
|
||||
|
||||
if (DatItemMappings.Keys.Contains(DatItemField.SaveStateStatus))
|
||||
driver.SaveState = DatItemMappings[DatItemField.SaveStateStatus].AsSupported();
|
||||
|
||||
if (DatItemMappings.Keys.Contains(DatItemField.RequiresArtwork))
|
||||
driver.RequiresArtwork = DatItemMappings[DatItemField.RequiresArtwork].AsYesNo();
|
||||
|
||||
if (DatItemMappings.Keys.Contains(DatItemField.Unofficial))
|
||||
driver.Unofficial = DatItemMappings[DatItemField.Unofficial].AsYesNo();
|
||||
|
||||
if (DatItemMappings.Keys.Contains(DatItemField.NoSoundHardware))
|
||||
driver.NoSoundHardware = DatItemMappings[DatItemField.NoSoundHardware].AsYesNo();
|
||||
|
||||
if (DatItemMappings.Keys.Contains(DatItemField.Incomplete))
|
||||
driver.Incomplete = DatItemMappings[DatItemField.Incomplete].AsYesNo();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -58,6 +58,46 @@ namespace SabreTools.DatItems.Formats
|
||||
[JsonIgnore]
|
||||
public bool SaveStateSpecified { get { return SaveState != Supported.NULL; } }
|
||||
|
||||
/// <summary>
|
||||
/// Requires artwork
|
||||
/// </summary>
|
||||
[JsonProperty("requiresartwork", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("requiresartwork")]
|
||||
public bool? RequiresArtwork { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool RequiresArtworkSpecified { get { return RequiresArtwork != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Unofficial
|
||||
/// </summary>
|
||||
[JsonProperty("unofficial", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("unofficial")]
|
||||
public bool? Unofficial { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool UnofficialSpecified { get { return Unofficial != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// No sound hardware
|
||||
/// </summary>
|
||||
[JsonProperty("nosoundhardware", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("nosoundhardware")]
|
||||
public bool? NoSoundHardware { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool NoSoundHardwareSpecified { get { return NoSoundHardware != null; } }
|
||||
|
||||
/// <summary>
|
||||
/// Incomplete
|
||||
/// </summary>
|
||||
[JsonProperty("incomplete", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
[XmlElement("incomplete")]
|
||||
public bool? Incomplete { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IncompleteSpecified { get { return Incomplete != null; } }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
@@ -89,6 +129,10 @@ namespace SabreTools.DatItems.Formats
|
||||
Emulation = this.Emulation,
|
||||
Cocktail = this.Cocktail,
|
||||
SaveState = this.SaveState,
|
||||
RequiresArtwork = this.RequiresArtwork,
|
||||
Unofficial = this.Unofficial,
|
||||
NoSoundHardware = this.NoSoundHardware,
|
||||
Incomplete = this.Incomplete,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -109,7 +153,11 @@ namespace SabreTools.DatItems.Formats
|
||||
return (Status == newOther.Status
|
||||
&& Emulation == newOther.Emulation
|
||||
&& Cocktail == newOther.Cocktail
|
||||
&& SaveState == newOther.SaveState);
|
||||
&& SaveState == newOther.SaveState
|
||||
&& RequiresArtwork == newOther.RequiresArtwork
|
||||
&& Unofficial == newOther.Unofficial
|
||||
&& NoSoundHardware == newOther.NoSoundHardware
|
||||
&& Incomplete == newOther.Incomplete);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -143,6 +143,10 @@ namespace SabreTools.Filtering
|
||||
public FilterItem<SupportStatus> EmulationStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = Core.SupportStatus.NULL, Negative = Core.SupportStatus.NULL };
|
||||
public FilterItem<SupportStatus> CocktailStatus { get; private set; } = new FilterItem<SupportStatus>() { Positive = Core.SupportStatus.NULL, Negative = Core.SupportStatus.NULL };
|
||||
public FilterItem<Supported> SaveStateStatus { get; private set; } = new FilterItem<Supported>() { Positive = Supported.NULL, Negative = Supported.NULL };
|
||||
public FilterItem<bool?> RequiresArtwork { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||
public FilterItem<bool?> Unofficial { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||
public FilterItem<bool?> NoSoundHardware { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||
public FilterItem<bool?> Incomplete { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||
|
||||
// Extension
|
||||
public FilterItem<string> Extension_Name { get; private set; } = new FilterItem<string>();
|
||||
@@ -653,6 +657,22 @@ namespace SabreTools.Filtering
|
||||
SaveStateStatus.Positive |= value.AsSupported();
|
||||
break;
|
||||
|
||||
case DatItemField.RequiresArtwork:
|
||||
SetBooleanFilter(RequiresArtwork, value, negate);
|
||||
break;
|
||||
|
||||
case DatItemField.Unofficial:
|
||||
SetBooleanFilter(Unofficial, value, negate);
|
||||
break;
|
||||
|
||||
case DatItemField.NoSoundHardware:
|
||||
SetBooleanFilter(NoSoundHardware, value, negate);
|
||||
break;
|
||||
|
||||
case DatItemField.Incomplete:
|
||||
SetBooleanFilter(Incomplete, value, negate);
|
||||
break;
|
||||
|
||||
// Extension
|
||||
case DatItemField.Extension_Name:
|
||||
SetStringFilter(Extension_Name, value, negate);
|
||||
@@ -1430,7 +1450,23 @@ namespace SabreTools.Filtering
|
||||
return false;
|
||||
if (SaveStateStatus.MatchesNegative(Supported.NULL, driver.SaveState) == true)
|
||||
return false;
|
||||
|
||||
|
||||
// Filter on requires artwork
|
||||
if (!PassBoolFilter(RequiresArtwork, driver.RequiresArtwork))
|
||||
return false;
|
||||
|
||||
// Filter on unofficial
|
||||
if (!PassBoolFilter(Unofficial, driver.Unofficial))
|
||||
return false;
|
||||
|
||||
// Filter on no sound hardware
|
||||
if (!PassBoolFilter(NoSoundHardware, driver.NoSoundHardware))
|
||||
return false;
|
||||
|
||||
// Filter on incomplete
|
||||
if (!PassBoolFilter(Incomplete, driver.Incomplete))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -666,6 +666,18 @@ namespace SabreTools.Filtering
|
||||
|
||||
if (DatItemFields.Contains(DatItemField.SaveStateStatus))
|
||||
driver.SaveState = Supported.NULL;
|
||||
|
||||
if (DatItemFields.Contains(DatItemField.RequiresArtwork))
|
||||
driver.RequiresArtwork = null;
|
||||
|
||||
if (DatItemFields.Contains(DatItemField.Unofficial))
|
||||
driver.Unofficial = null;
|
||||
|
||||
if (DatItemFields.Contains(DatItemField.NoSoundHardware))
|
||||
driver.NoSoundHardware = null;
|
||||
|
||||
if (DatItemFields.Contains(DatItemField.Incomplete))
|
||||
driver.Incomplete = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -608,6 +608,18 @@ namespace SabreTools.Filtering
|
||||
|
||||
if (datItemFields.Contains(DatItemField.SaveStateStatus))
|
||||
driver.SaveState = newItem.SaveState;
|
||||
|
||||
if (datItemFields.Contains(DatItemField.RequiresArtwork))
|
||||
driver.RequiresArtwork = newItem.RequiresArtwork;
|
||||
|
||||
if (datItemFields.Contains(DatItemField.Unofficial))
|
||||
driver.Unofficial = newItem.Unofficial;
|
||||
|
||||
if (datItemFields.Contains(DatItemField.NoSoundHardware))
|
||||
driver.NoSoundHardware = newItem.NoSoundHardware;
|
||||
|
||||
if (datItemFields.Contains(DatItemField.Incomplete))
|
||||
driver.Incomplete = newItem.Incomplete;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user