From 094860bfea380eec0ce876dc0339e906cc142bb2 Mon Sep 17 00:00:00 2001 From: Salman Alshamrani Date: Thu, 18 Dec 2025 06:17:07 -0500 Subject: [PATCH] Define delegate for applying classic defaults --- osu.Game/Overlays/Settings/SettingsItemV2.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Settings/SettingsItemV2.cs b/osu.Game/Overlays/Settings/SettingsItemV2.cs index 622df50b91..bd246211b6 100644 --- a/osu.Game/Overlays/Settings/SettingsItemV2.cs +++ b/osu.Game/Overlays/Settings/SettingsItemV2.cs @@ -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; + + /// + /// If set, this setting is considered as having a "classic" default value, + /// and this is the function for overwriting the control with that value. + /// + 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)