mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:43:05 +08:00
Copy values using Bind to also copy defaults
This commit is contained in:
parent
6ad1b7767e
commit
2501707d7d
@ -150,7 +150,17 @@ namespace osu.Game.Rulesets.Mods
|
||||
/// </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
Block a user