mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 16:50:21 +08:00
Define delegate for applying classic defaults
This commit is contained in:
@@ -105,14 +105,26 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
#region ISettingsItem
|
||||
|
||||
public bool HasClassicDefault { get; init; }
|
||||
public bool HasClassicDefault { get; private set; }
|
||||
|
||||
public void ApplyClassicDefault()
|
||||
private Action? applyClassicDefault;
|
||||
|
||||
/// <summary>
|
||||
/// If set, this setting is considered as having a "classic" default value,
|
||||
/// and this is the function for overwriting the control with that value.
|
||||
/// </summary>
|
||||
public Action? ApplyClassicDefault
|
||||
{
|
||||
// will be removed soon.
|
||||
throw new NotSupportedException();
|
||||
get => applyClassicDefault;
|
||||
set
|
||||
{
|
||||
applyClassicDefault = value;
|
||||
HasClassicDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ISettingsItem.ApplyClassicDefault() => ApplyClassicDefault?.Invoke();
|
||||
|
||||
public void ApplyDefault()
|
||||
{
|
||||
if (!control.IsDisabled)
|
||||
|
||||
Reference in New Issue
Block a user