diff --git a/SabreTools.Library/DatFiles/Json.cs b/SabreTools.Library/DatFiles/Json.cs index fa92d789..e7a5f11e 100644 --- a/SabreTools.Library/DatFiles/Json.cs +++ b/SabreTools.Library/DatFiles/Json.cs @@ -262,6 +262,9 @@ namespace SabreTools.Library.DatFiles case ItemType.Instance: datItem = datItemObj.ToObject(); break; + case ItemType.Location: + datItem = datItemObj.ToObject(); + break; case ItemType.Media: datItem = datItemObj.ToObject(); break; @@ -280,6 +283,9 @@ namespace SabreTools.Library.DatFiles case ItemType.Sample: datItem = datItemObj.ToObject(); break; + case ItemType.Setting: + datItem = datItemObj.ToObject(); + break; case ItemType.Slot: datItem = datItemObj.ToObject(); break; diff --git a/SabreTools.Library/DatItems/Auxiliary.cs b/SabreTools.Library/DatItems/Auxiliary.cs index bee82e4b..8a2e5167 100644 --- a/SabreTools.Library/DatItems/Auxiliary.cs +++ b/SabreTools.Library/DatItems/Auxiliary.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.IO; using System.Linq; using SabreTools.Library.DatItems; @@ -99,70 +100,6 @@ namespace SabreTools.Library.DatItems #endregion } - /// - /// Represents one ListXML conflocation or diplocation - /// - [JsonObject("location")] - public class Location - { - #region Fields - - /// - /// Location name - /// - [JsonProperty("name")] - public string Name { get; set; } - - /// - /// Location ID - /// - [JsonProperty("number", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Number { get; set; } - - /// - /// Determines if location is inverted or not - /// - [JsonProperty("inverted", DefaultValueHandling = DefaultValueHandling.Ignore)] - public bool? Inverted { get; set; } - - #endregion - } - - /// - /// Represents one ListXML confsetting or dipvalue - /// - [JsonObject("setting")] - public class Setting - { - #region Fields - - /// - /// Setting name - /// - [JsonProperty("name")] - public string Name { get; set; } - - /// - /// Setting value - /// - [JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)] - public string Value { get; set; } - - /// - /// Determines if the setting is default or not - /// - [JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)] - public bool? Default { get; set; } - - /// - /// List of conditions on the setting - /// - [JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)] - public List Conditions { get; set; } - - #endregion - } - /// /// Represents one ListXML slotoption /// diff --git a/SabreTools.Library/DatItems/Condition.cs b/SabreTools.Library/DatItems/Condition.cs index c6258dba..f99100dc 100644 --- a/SabreTools.Library/DatItems/Condition.cs +++ b/SabreTools.Library/DatItems/Condition.cs @@ -4,9 +4,6 @@ using System.Linq; using SabreTools.Library.Filtering; using Newtonsoft.Json; -/// -/// This holds all of the auxiliary types needed for proper parsing -/// namespace SabreTools.Library.DatItems { /// diff --git a/SabreTools.Library/DatItems/Configuration.cs b/SabreTools.Library/DatItems/Configuration.cs index b5e694a4..fdbfbb14 100644 --- a/SabreTools.Library/DatItems/Configuration.cs +++ b/SabreTools.Library/DatItems/Configuration.cs @@ -84,9 +84,32 @@ namespace SabreTools.Library.DatItems if (mappings.Keys.Contains(Field.DatItem_Mask)) Mask = mappings[Field.DatItem_Mask]; - // TODO: Handle DatItem_Condition* - // TODO: Handle DatItem_Location* - // TODO: Handle DatItem_Setting* + // Field.DatItem_Conditions does not apply here + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + condition.SetFields(mappings); + } + } + + // Field.DatItem_Locations does not apply here + if (Locations != null) + { + foreach (Location location in Locations) + { + location.SetFields(mappings); + } + } + + // Field.DatItem_Settings does not apply here + if (Settings != null) + { + foreach (Setting setting in Settings) + { + setting.SetFields(mappings); + } + } } #endregion @@ -158,11 +181,38 @@ namespace SabreTools.Library.DatItems Configuration newOther = other as Configuration; // If the Configuration information matches - return (Name == newOther.Name && Tag == newOther.Tag && Mask == newOther.Mask); - - // TODO: Handle DatItem_Condition* - // TODO: Handle DatItem_Location* - // TODO: Handle DatItem_Setting* + bool match = (Name == newOther.Name && Tag == newOther.Tag && Mask == newOther.Mask); + if (!match) + return match; + + // If the conditions match + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + match &= newOther.Conditions.Contains(condition); + } + } + + // If the locations match + if (Locations != null) + { + foreach (Location location in Locations) + { + match &= newOther.Locations.Contains(location); + } + } + + // If the settings match + if (Settings != null) + { + foreach (Setting setting in Settings) + { + match &= newOther.Settings.Contains(setting); + } + } + + return match; } #endregion @@ -225,9 +275,47 @@ namespace SabreTools.Library.DatItems if (filter.DatItem_Mask.MatchesNegativeSet(Mask) == true) return false; - // TODO: Handle DatItem_Condition* - // TODO: Handle DatItem_Location* - // TODO: Handle DatItem_Setting* + // Filter on conditions + if (filter.DatItem_Conditions.MatchesNeutral(null, Conditions != null ? (bool?)(Conditions.Count > 0) : null) == false) + return false; + + // Filter on individual conditions + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + if (!condition.PassesFilter(filter)) + return false; + } + } + + // Filter on locations + if (filter.DatItem_Locations.MatchesNeutral(null, Locations != null ? (bool?)(Locations.Count > 0) : null) == false) + return false; + + // Filter on individual locations + if (Locations != null) + { + foreach (Location location in Locations) + { + if (!location.PassesFilter(filter)) + return false; + } + } + + // Filter on settings + if (filter.DatItem_Settings.MatchesNeutral(null, Settings != null ? (bool?)(Settings.Count > 0) : null) == false) + return false; + + // Filter on individual conditions + if (Settings != null) + { + foreach (Setting setting in Settings) + { + if (!setting.PassesFilter(filter)) + return false; + } + } return true; } @@ -254,15 +342,35 @@ namespace SabreTools.Library.DatItems if (fields.Contains(Field.DatItem_Conditions)) Conditions = null; + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + condition.RemoveFields(fields); + } + } + if (fields.Contains(Field.DatItem_Locations)) Locations = null; + if (Locations != null) + { + foreach (Location location in Locations) + { + location.RemoveFields(fields); + } + } + if (fields.Contains(Field.DatItem_Settings)) Settings = null; - // TODO: Handle DatItem_Condition* - // TODO: Handle DatItem_Location* - // TODO: Handle DatItem_Setting* + if (Settings != null) + { + foreach (Setting setting in Settings) + { + setting.RemoveFields(fields); + } + } } /// @@ -309,15 +417,17 @@ namespace SabreTools.Library.DatItems if (fields.Contains(Field.DatItem_Conditions)) Conditions = newItem.Conditions; + // Field replacement doesn't make sense for DatItem_Condition* + if (fields.Contains(Field.DatItem_Locations)) Locations = newItem.Locations; + // Field replacement doesn't make sense for DatItem_Location* + if (fields.Contains(Field.DatItem_Settings)) Settings = newItem.Settings; - // TODO: Handle DatItem_Condition* - // TODO: Handle DatItem_Location* - // TODO: Handle DatItem_Setting* + // Field replacement doesn't make sense for DatItem_Setting* } #endregion diff --git a/SabreTools.Library/DatItems/DatItem.cs b/SabreTools.Library/DatItems/DatItem.cs index ff2200f3..cdf10123 100644 --- a/SabreTools.Library/DatItems/DatItem.cs +++ b/SabreTools.Library/DatItems/DatItem.cs @@ -509,6 +509,9 @@ namespace SabreTools.Library.DatItems case ItemType.Instance: return new Instance(); + case ItemType.Location: + return new Location(); + case ItemType.Media: return new Media(); @@ -527,6 +530,9 @@ namespace SabreTools.Library.DatItems case ItemType.Sample: return new Sample(); + case ItemType.Setting: + return new Setting(); + case ItemType.Slot: return new Slot(); @@ -559,6 +565,7 @@ namespace SabreTools.Library.DatItems ItemType.Extension => new Extension(), ItemType.Feature => new Feature(), ItemType.Instance => new Instance(), + ItemType.Location => new Location(), ItemType.Media => new Media(), ItemType.Port => new Port(), ItemType.RamOption => new RamOption(), diff --git a/SabreTools.Library/DatItems/Device.cs b/SabreTools.Library/DatItems/Device.cs index 90c7ce09..152a8b84 100644 --- a/SabreTools.Library/DatItems/Device.cs +++ b/SabreTools.Library/DatItems/Device.cs @@ -4,9 +4,6 @@ using System.Linq; using SabreTools.Library.Filtering; using Newtonsoft.Json; -/// -/// This holds all of the auxiliary types needed for proper parsing -/// namespace SabreTools.Library.DatItems { /// diff --git a/SabreTools.Library/DatItems/Display.cs b/SabreTools.Library/DatItems/Display.cs index 18244726..b0acc58a 100644 --- a/SabreTools.Library/DatItems/Display.cs +++ b/SabreTools.Library/DatItems/Display.cs @@ -4,9 +4,6 @@ using SabreTools.Library.Filtering; using Newtonsoft.Json; using SabreTools.Library.Tools; -/// -/// This holds all of the auxiliary types needed for proper parsing -/// namespace SabreTools.Library.DatItems { /// diff --git a/SabreTools.Library/DatItems/Enums.cs b/SabreTools.Library/DatItems/Enums.cs index 97fb5ca1..1597e649 100644 --- a/SabreTools.Library/DatItems/Enums.cs +++ b/SabreTools.Library/DatItems/Enums.cs @@ -492,10 +492,12 @@ namespace SabreTools.Library.DatItems Feature, Input, Instance, + Location, Port, RamOption, Release, Sample, + Setting, Slot, SoftwareList, Sound, diff --git a/SabreTools.Library/DatItems/Input.cs b/SabreTools.Library/DatItems/Input.cs index e1ee9c0f..4b4bffb9 100644 --- a/SabreTools.Library/DatItems/Input.cs +++ b/SabreTools.Library/DatItems/Input.cs @@ -4,9 +4,6 @@ using SabreTools.Library.Filtering; using Newtonsoft.Json; using SabreTools.Library.Tools; -/// -/// This holds all of the auxiliary types needed for proper parsing -/// namespace SabreTools.Library.DatItems { /// diff --git a/SabreTools.Library/DatItems/Location.cs b/SabreTools.Library/DatItems/Location.cs new file mode 100644 index 00000000..33a0dc42 --- /dev/null +++ b/SabreTools.Library/DatItems/Location.cs @@ -0,0 +1,265 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using SabreTools.Library.Filtering; +using Newtonsoft.Json; +using SabreTools.Library.Tools; + +namespace SabreTools.Library.DatItems +{ + /// + /// Represents one conflocation or diplocation + /// + [JsonObject("location")] + public class Location : DatItem + { + #region Fields + + /// + /// Location name + /// + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// Location ID + /// + [JsonProperty("number", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string Number { get; set; } + + /// + /// Determines if location is inverted or not + /// + [JsonProperty("inverted", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool? Inverted { get; set; } + + #endregion + + #region Accessors + + /// + /// Gets the name to use for a DatItem + /// + /// Name if available, null otherwise + public override string GetName() + { + return Name; + } + + /// + /// Set fields with given values + /// + /// Mappings dictionary + public override void SetFields(Dictionary mappings) + { + // Set base fields + base.SetFields(mappings); + + // Handle Location-specific fields + if (mappings.Keys.Contains(Field.DatItem_Location_Name)) + Name = mappings[Field.DatItem_Location_Name]; + + if (mappings.Keys.Contains(Field.DatItem_Location_Number)) + Number = mappings[Field.DatItem_Location_Number]; + + if (mappings.Keys.Contains(Field.DatItem_Location_Inverted)) + Inverted = mappings[Field.DatItem_Location_Inverted].AsYesNo(); + } + + #endregion + + #region Constructors + + /// + /// Create a default, empty Location object + /// + public Location() + { + Name = string.Empty; + ItemType = ItemType.Location; + } + + #endregion + + #region Cloning Methods + + public override object Clone() + { + return new Location() + { + Name = this.Name, + ItemType = this.ItemType, + DupeType = this.DupeType, + + AltName = this.AltName, + AltTitle = this.AltTitle, + + Original = this.Original, + OpenMSXSubType = this.OpenMSXSubType, + OpenMSXType = this.OpenMSXType, + Remark = this.Remark, + Boot = this.Boot, + + Part = this.Part, + Features = this.Features, + AreaName = this.AreaName, + AreaSize = this.AreaSize, + AreaWidth = this.AreaWidth, + AreaEndianness = this.AreaEndianness, + Value = this.Value, + LoadFlag = this.LoadFlag, + + Machine = this.Machine.Clone() as Machine, + Source = this.Source.Clone() as Source, + Remove = this.Remove, + + Number = this.Number, + Inverted = this.Inverted, + }; + } + + #endregion + + #region Comparision Methods + + public override bool Equals(DatItem other) + { + // If we don't have a Location, return false + if (ItemType != other.ItemType) + return false; + + // Otherwise, treat it as a Location + Location newOther = other as Location; + + // If the Location information matches + return (Name == newOther.Name + && Number == newOther.Number + && Inverted == newOther.Inverted); + } + + #endregion + + #region Filtering + + /// + /// Clean a DatItem according to the cleaner + /// + /// Cleaner to implement + public override void Clean(Cleaner cleaner) + { + // Clean common items first + base.Clean(cleaner); + + // If we're stripping unicode characters, strip item name + if (cleaner?.RemoveUnicode == true) + Name = Sanitizer.RemoveUnicodeCharacters(Name); + + // If we are in NTFS trim mode, trim the game name + if (cleaner?.Trim == true) + { + // Windows max name length is 260 + int usableLength = 260 - Machine.Name.Length - (cleaner.Root?.Length ?? 0); + if (Name.Length > usableLength) + { + string ext = Path.GetExtension(Name); + Name = Name.Substring(0, usableLength - ext.Length); + Name += ext; + } + } + } + + /// + /// Check to see if a DatItem passes the filter + /// + /// Filter to check against + /// True if the item passed the filter, false otherwise + public override bool PassesFilter(Filter filter) + { + // Check common fields first + if (!base.PassesFilter(filter)) + return false; + + // Filter on item name + if (filter.DatItem_Location_Name.MatchesPositiveSet(Name) == false) + return false; + if (filter.DatItem_Location_Name.MatchesNegativeSet(Name) == true) + return false; + + // Filter on number + if (filter.DatItem_Location_Number.MatchesPositiveSet(Number) == false) + return false; + if (filter.DatItem_Location_Number.MatchesNegativeSet(Number) == true) + return false; + + // Filter on inverted + if (filter.DatItem_Location_Inverted.MatchesNeutral(null, Inverted) == false) + return false; + + return true; + } + + /// + /// Remove fields from the DatItem + /// + /// List of Fields to remove + public override void RemoveFields(List fields) + { + // Remove common fields first + base.RemoveFields(fields); + + // Remove the fields + if (fields.Contains(Field.DatItem_Location_Name)) + Name = null; + + if (fields.Contains(Field.DatItem_Location_Number)) + Number = null; + + if (fields.Contains(Field.DatItem_Location_Inverted)) + Inverted = null; + } + + /// + /// Set internal names to match One Rom Per Game (ORPG) logic + /// + public override void SetOneRomPerGame() + { + string[] splitname = Name.Split('.'); + Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}"; + Name = Path.GetFileName(Name); + } + + #endregion + + #region Sorting and Merging + + /// + /// Replace fields from another item + /// + /// DatItem to pull new information from + /// List of Fields representing what should be updated + public override void ReplaceFields(DatItem item, List fields) + { + // Replace common fields first + base.ReplaceFields(item, fields); + + // If we don't have a Location to replace from, ignore specific fields + if (item.ItemType != ItemType.Location) + return; + + // Cast for easier access + Location newItem = item as Location; + + // Replace the fields + if (fields.Contains(Field.DatItem_Location_Name)) + Name = newItem.Name; + + if (fields.Contains(Field.DatItem_Location_Number)) + Number = newItem.Number; + + if (fields.Contains(Field.DatItem_Location_Inverted)) + Inverted = newItem.Inverted; + } + + #endregion + } +} diff --git a/SabreTools.Library/DatItems/Setting.cs b/SabreTools.Library/DatItems/Setting.cs new file mode 100644 index 00000000..62702781 --- /dev/null +++ b/SabreTools.Library/DatItems/Setting.cs @@ -0,0 +1,321 @@ +using System.Collections.Generic; +using System.IO; +using System.Linq; +using SabreTools.Library.Filtering; +using Newtonsoft.Json; +using SabreTools.Library.Tools; + +namespace SabreTools.Library.DatItems +{ + /// + /// Represents one ListXML confsetting or dipvalue + /// + [JsonObject("setting")] + public class Setting : DatItem + { + #region Fields + + /// + /// Setting name + /// + [JsonProperty("name")] + public string Name { get; set; } + + /// + /// Setting value + /// + [JsonProperty("value", DefaultValueHandling = DefaultValueHandling.Ignore)] + public string SettingValue { get; set; } + + /// + /// Determines if the setting is default or not + /// + [JsonProperty("default", DefaultValueHandling = DefaultValueHandling.Ignore)] + public bool? Default { get; set; } + + /// + /// List of conditions on the setting + /// + [JsonProperty("conditions", DefaultValueHandling = DefaultValueHandling.Ignore)] + public List Conditions { get; set; } + + #endregion + + #region Accessors + + /// + /// Gets the name to use for a DatItem + /// + /// Name if available, null otherwise + public override string GetName() + { + return Name; + } + + /// + /// Set fields with given values + /// + /// Mappings dictionary + public override void SetFields(Dictionary mappings) + { + // Set base fields + base.SetFields(mappings); + + // Handle Setting-specific fields + if (mappings.Keys.Contains(Field.DatItem_Setting_Name)) + Name = mappings[Field.DatItem_Setting_Name]; + + if (mappings.Keys.Contains(Field.DatItem_Setting_Value)) + SettingValue = mappings[Field.DatItem_Setting_Value]; + + if (mappings.Keys.Contains(Field.DatItem_Setting_Default)) + Default = mappings[Field.DatItem_Setting_Default].AsYesNo(); + + // Field.DatItem_Conditions does not apply here + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + condition.SetFields(mappings); + } + } + } + + #endregion + + #region Constructors + + /// + /// Create a default, empty Setting object + /// + public Setting() + { + Name = string.Empty; + ItemType = ItemType.Setting; + } + + #endregion + + #region Cloning Methods + + public override object Clone() + { + return new Setting() + { + Name = this.Name, + ItemType = this.ItemType, + DupeType = this.DupeType, + + AltName = this.AltName, + AltTitle = this.AltTitle, + + Original = this.Original, + OpenMSXSubType = this.OpenMSXSubType, + OpenMSXType = this.OpenMSXType, + Remark = this.Remark, + Boot = this.Boot, + + Part = this.Part, + Features = this.Features, + AreaName = this.AreaName, + AreaSize = this.AreaSize, + AreaWidth = this.AreaWidth, + AreaEndianness = this.AreaEndianness, + Value = this.Value, + LoadFlag = this.LoadFlag, + + Machine = this.Machine.Clone() as Machine, + Source = this.Source.Clone() as Source, + Remove = this.Remove, + + SettingValue = this.SettingValue, + Default = this.Default, + Conditions = this.Conditions, + }; + } + + #endregion + + #region Comparision Methods + + public override bool Equals(DatItem other) + { + // If we don't have a Setting, return false + if (ItemType != other.ItemType) + return false; + + // Otherwise, treat it as a Setting + Setting newOther = other as Setting; + + // If the Setting information matches + bool match = (Name == newOther.Name + && SettingValue == newOther.SettingValue + && Default == newOther.Default); + if (!match) + return match; + + // If the conditions match + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + match &= newOther.Conditions.Contains(condition); + } + } + + return match; + } + + #endregion + + #region Filtering + + /// + /// Clean a DatItem according to the cleaner + /// + /// Cleaner to implement + public override void Clean(Cleaner cleaner) + { + // Clean common items first + base.Clean(cleaner); + + // If we're stripping unicode characters, strip item name + if (cleaner?.RemoveUnicode == true) + Name = Sanitizer.RemoveUnicodeCharacters(Name); + + // If we are in NTFS trim mode, trim the game name + if (cleaner?.Trim == true) + { + // Windows max name length is 260 + int usableLength = 260 - Machine.Name.Length - (cleaner.Root?.Length ?? 0); + if (Name.Length > usableLength) + { + string ext = Path.GetExtension(Name); + Name = Name.Substring(0, usableLength - ext.Length); + Name += ext; + } + } + } + + /// + /// Check to see if a DatItem passes the filter + /// + /// Filter to check against + /// True if the item passed the filter, false otherwise + public override bool PassesFilter(Filter filter) + { + // Check common fields first + if (!base.PassesFilter(filter)) + return false; + + // Filter on item name + if (filter.DatItem_Setting_Name.MatchesPositiveSet(Name) == false) + return false; + if (filter.DatItem_Setting_Name.MatchesNegativeSet(Name) == true) + return false; + + // Filter on value + if (filter.DatItem_Setting_Value.MatchesPositiveSet(SettingValue) == false) + return false; + if (filter.DatItem_Setting_Value.MatchesNegativeSet(SettingValue) == true) + return false; + + // Filter on default + if (filter.DatItem_Setting_Default.MatchesNeutral(null, Default) == false) + return false; + + // Filter on conditions + if (filter.DatItem_Conditions.MatchesNeutral(null, Conditions != null ? (bool?)(Conditions.Count > 0) : null) == false) + return false; + + // Filter on individual conditions + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + if (!condition.PassesFilter(filter)) + return false; + } + } + + return true; + } + + /// + /// Remove fields from the DatItem + /// + /// List of Fields to remove + public override void RemoveFields(List fields) + { + // Remove common fields first + base.RemoveFields(fields); + + // Remove the fields + if (fields.Contains(Field.DatItem_Setting_Name)) + Name = null; + + if (fields.Contains(Field.DatItem_Setting_Value)) + SettingValue = null; + + if (fields.Contains(Field.DatItem_Setting_Default)) + Default = null; + + if (fields.Contains(Field.DatItem_Conditions)) + Conditions = null; + + if (Conditions != null) + { + foreach (Condition condition in Conditions) + { + condition.RemoveFields(fields); + } + } + } + + /// + /// Set internal names to match One Rom Per Game (ORPG) logic + /// + public override void SetOneRomPerGame() + { + string[] splitname = Name.Split('.'); + Machine.Name += $"/{string.Join(".", splitname.Take(splitname.Length > 1 ? splitname.Length - 1 : 1))}"; + Name = Path.GetFileName(Name); + } + + #endregion + + #region Sorting and Merging + + /// + /// Replace fields from another item + /// + /// DatItem to pull new information from + /// List of Fields representing what should be updated + public override void ReplaceFields(DatItem item, List fields) + { + // Replace common fields first + base.ReplaceFields(item, fields); + + // If we don't have a Setting to replace from, ignore specific fields + if (item.ItemType != ItemType.Setting) + return; + + // Cast for easier access + Setting newItem = item as Setting; + + // Replace the fields + if (fields.Contains(Field.DatItem_Setting_Name)) + Name = newItem.Name; + + if (fields.Contains(Field.DatItem_Setting_Value)) + SettingValue = newItem.SettingValue; + + if (fields.Contains(Field.DatItem_Setting_Default)) + Default = newItem.Default; + + // Field replacement doesn't make sense for DatItem_Condition* + } + + #endregion + } +} diff --git a/SabreTools.Library/Tools/Converters.cs b/SabreTools.Library/Tools/Converters.cs index 0480cb40..e917b1b9 100644 --- a/SabreTools.Library/Tools/Converters.cs +++ b/SabreTools.Library/Tools/Converters.cs @@ -1675,6 +1675,8 @@ namespace SabreTools.Library.Tools return ItemType.Input; case "instance": return ItemType.Instance; + case "location": + return ItemType.Location; case "media": return ItemType.Media; case "port": @@ -1687,6 +1689,8 @@ namespace SabreTools.Library.Tools return ItemType.Rom; case "sample": return ItemType.Sample; + case "setting": + return ItemType.Setting; case "slot": return ItemType.Slot; case "softwarelist": @@ -1717,12 +1721,14 @@ namespace SabreTools.Library.Tools "feature" => ItemType.Feature, "input" => ItemType.Input, "instance" => ItemType.Instance, + "location" => ItemType.Location, "media" => ItemType.Media, "port" => ItemType.Port, "ramoption" => ItemType.RamOption, "release" => ItemType.Release, "rom" => ItemType.Rom, "sample" => ItemType.Sample, + "setting" => ItemType.Setting, "slot" => ItemType.Slot, "softwarelist" => ItemType.SoftwareList, "sound" => ItemType.Sound, @@ -2304,6 +2310,8 @@ namespace SabreTools.Library.Tools return "input"; case ItemType.Instance: return "instance"; + case ItemType.Location: + return "location"; case ItemType.Media: return "media"; case ItemType.Port: @@ -2316,6 +2324,8 @@ namespace SabreTools.Library.Tools return "rom"; case ItemType.Sample: return "sample"; + case ItemType.Setting: + return "setting"; case ItemType.Slot: return "slot"; case ItemType.SoftwareList: @@ -2346,12 +2356,14 @@ namespace SabreTools.Library.Tools ItemType.Feature => "feature", ItemType.Input => "input", ItemType.Instance => "instance", + ItemType.Location => "location", ItemType.Media => "media", ItemType.Port => "port", ItemType.RamOption => "ramoption", ItemType.Release => "release", ItemType.Rom => "rom", ItemType.Sample => "sample", + ItemType.Setting => "setting", ItemType.Slot => "slot", ItemType.SoftwareList => "softwarelist", ItemType.Sound => "sound",