mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix consistency issues in converting to metadata
This commit is contained in:
@@ -35,6 +35,7 @@ namespace SabreTools.DatItems.Formats
|
||||
#region Constructors
|
||||
|
||||
public Input() : base() { }
|
||||
|
||||
public Input(Models.Metadata.Input item) : base(item)
|
||||
{
|
||||
// Process flag values
|
||||
@@ -59,5 +60,24 @@ namespace SabreTools.DatItems.Formats
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Cloning Methods
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override Models.Metadata.Input GetInternalClone()
|
||||
{
|
||||
var inputItem = base.GetInternalClone();
|
||||
|
||||
var controls = GetFieldValue<Control[]?>(Models.Metadata.Input.ControlKey);
|
||||
if (controls != null)
|
||||
{
|
||||
Models.Metadata.Control[] controlItems = Array.ConvertAll(controls, control => control.GetInternalClone());
|
||||
inputItem[Models.Metadata.Input.ControlKey] = controlItems;
|
||||
}
|
||||
|
||||
return inputItem;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user