1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-15 22:27:46 +08:00

Fix regression in ModSettingsChangeTracker

This commit is contained in:
Dean Herbert 2021-08-17 17:50:30 +09:00
parent 1b49e92e99
commit c0b388cd74

View File

@ -119,19 +119,19 @@ namespace osu.Game.Overlays.Settings
}, },
}, },
}; };
}
[BackgroundDependencyLoader] // IMPORTANT: all bindable logic is in constructor intentionally to support "CreateSettingsControls" being used in a context it is
private void load()
{
// all bindable logic is in constructor intentionally to support "CreateSettingsControls" being used in a context it is
// never loaded, but requires bindable storage. // never loaded, but requires bindable storage.
if (controlWithCurrent == null) if (controlWithCurrent == null)
throw new ArgumentException(@$"Control created via {nameof(CreateControl)} must implement {nameof(IHasCurrentValue<T>)}"); throw new ArgumentException(@$"Control created via {nameof(CreateControl)} must implement {nameof(IHasCurrentValue<T>)}");
controlWithCurrent.Current.ValueChanged += _ => SettingChanged?.Invoke(); controlWithCurrent.Current.ValueChanged += _ => SettingChanged?.Invoke();
controlWithCurrent.Current.DisabledChanged += _ => updateDisabled(); controlWithCurrent.Current.DisabledChanged += _ => updateDisabled();
}
[BackgroundDependencyLoader]
private void load()
{
// intentionally done before LoadComplete to avoid overhead. // intentionally done before LoadComplete to avoid overhead.
if (ShowsDefaultIndicator) if (ShowsDefaultIndicator)
{ {