1
0
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:
Salman Alshamrani
2025-12-18 06:17:07 -05:00
Unverified
parent f5bd888078
commit 094860bfea
+16 -4
View File
@@ -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)