diff --git a/osu.Game.Tests/NonVisual/SessionStaticsTest.cs b/osu.Game.Tests/NonVisual/SessionStaticsTest.cs index d5fd803986..fbb0eed4fc 100644 --- a/osu.Game.Tests/NonVisual/SessionStaticsTest.cs +++ b/osu.Game.Tests/NonVisual/SessionStaticsTest.cs @@ -27,7 +27,7 @@ namespace osu.Game.Tests.NonVisual sessionIdleTracker.IsIdle.BindValueChanged(e => { if (e.NewValue) - sessionStatics.ResetValues(); + sessionStatics.ResetAfterInactivity(); }); } diff --git a/osu.Game/Configuration/SessionStatics.cs b/osu.Game/Configuration/SessionStatics.cs index 99f1e5a8b2..fca0ad9641 100644 --- a/osu.Game/Configuration/SessionStatics.cs +++ b/osu.Game/Configuration/SessionStatics.cs @@ -15,23 +15,25 @@ namespace osu.Game.Configuration { protected override void InitialiseDefaults() { - ensureDefault(SetDefault(Static.LoginOverlayDisplayed, false)); - ensureDefault(SetDefault(Static.MutedAudioNotificationShownOnce, false)); - ensureDefault(SetDefault(Static.LowBatteryNotificationShownOnce, false)); - ensureDefault(SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null)); - ensureDefault(SetDefault(Static.SeasonalBackgrounds, null)); + SetDefault(Static.LoginOverlayDisplayed, false); + SetDefault(Static.MutedAudioNotificationShownOnce, false); + SetDefault(Static.LowBatteryNotificationShownOnce, false); + SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null); + SetDefault(Static.SeasonalBackgrounds, null); } /// - /// Used to revert statics to their defaults after being idle for appropiate amount of time. - /// Does not affect loaded seasonal backgrounds. + /// Revert statics to their defaults after being idle for appropriate amount of time. /// - public void ResetValues() + /// + /// This only affects a subset of statics which the user would expect to have reset after a break. + /// + public void ResetAfterInactivity() { - ensureDefault(GetBindable(Static.LoginOverlayDisplayed)); - ensureDefault(GetBindable(Static.MutedAudioNotificationShownOnce)); - ensureDefault(GetBindable(Static.LowBatteryNotificationShownOnce)); - ensureDefault(GetBindable(Static.LastHoverSoundPlaybackTime)); + GetBindable(Static.LoginOverlayDisplayed).SetDefault(); + GetBindable(Static.MutedAudioNotificationShownOnce).SetDefault(); + GetBindable(Static.LowBatteryNotificationShownOnce).SetDefault(); + GetBindable(Static.LastHoverSoundPlaybackTime).SetDefault(); } private void ensureDefault(Bindable bindable) => bindable.SetDefault(); diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index a4471b56b9..c5a465ae96 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -680,7 +680,7 @@ namespace osu.Game sessionIdleTracker.IsIdle.BindValueChanged(idle => { if (idle.NewValue) - SessionStatics.ResetValues(); + SessionStatics.ResetAfterInactivity(); }); Add(sessionIdleTracker);