mirror of https://github.com/ppy/osu
Copy values using Bind to also copy defaults
This commit is contained in:
parent
6ad1b7767e
commit
2501707d7d
|
@ -150,7 +150,17 @@ public virtual Mod CreateCopy()
|
|||
/// </summary>
|
||||
/// <param name="bindable">The target bindable to apply the adjustment.</param>
|
||||
/// <param name="value">The adjustment to apply.</param>
|
||||
internal virtual void CopyAdjustedSetting(IBindable bindable, object value) => bindable.Parse(value);
|
||||
internal virtual void CopyAdjustedSetting(IBindable bindable, object value)
|
||||
{
|
||||
if (value is IBindable incoming)
|
||||
{
|
||||
//copy including transfer of default values.
|
||||
bindable.BindTo(incoming);
|
||||
bindable.UnbindFrom(incoming);
|
||||
}
|
||||
else
|
||||
bindable.Parse(value);
|
||||
}
|
||||
|
||||
public bool Equals(IMod other) => GetType() == other?.GetType();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue