mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 14:50:54 +08:00
Simplify classic default flow
This commit is contained in:
@@ -105,23 +105,13 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
#region ISettingsItem
|
||||
|
||||
public bool HasClassicDefault { get; private set; }
|
||||
|
||||
private Action? applyClassicDefault;
|
||||
public bool HasClassicDefault => ApplyClassicDefault != null;
|
||||
|
||||
/// <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
|
||||
{
|
||||
get => applyClassicDefault;
|
||||
set
|
||||
{
|
||||
applyClassicDefault = value;
|
||||
HasClassicDefault = true;
|
||||
}
|
||||
}
|
||||
public Action? ApplyClassicDefault { get; set; }
|
||||
|
||||
void ISettingsItem.ApplyClassicDefault() => ApplyClassicDefault?.Invoke();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user