diff --git a/osu.Game/Configuration/SessionStatics.cs b/osu.Game/Configuration/SessionStatics.cs index e57b1c2fdf..ac94c39bd2 100644 --- a/osu.Game/Configuration/SessionStatics.cs +++ b/osu.Game/Configuration/SessionStatics.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Bindables; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays; @@ -12,23 +13,18 @@ namespace osu.Game.Configuration /// public class SessionStatics : InMemoryConfigManager { - protected override void InitialiseDefaults() - { - SetDefault(Static.LoginOverlayDisplayed, false); - SetDefault(Static.MutedAudioNotificationShownOnce, false); - SetDefault(Static.LowBatteryNotificationShownOnce, false); - SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null); - SetDefault(Static.SeasonalBackgrounds, null); - } + protected override void InitialiseDefaults() => ResetValues(); public void ResetValues() { - GetOriginalBindable(Static.LoginOverlayDisplayed).SetDefault(); - GetOriginalBindable(Static.MutedAudioNotificationShownOnce).SetDefault(); - GetOriginalBindable(Static.LowBatteryNotificationShownOnce).SetDefault(); - GetOriginalBindable(Static.LastHoverSoundPlaybackTime).SetDefault(); - GetOriginalBindable(Static.SeasonalBackgrounds).SetDefault(); + 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)); } + + private void ensureDefault(Bindable bindable) => bindable.SetDefault(); } public enum Static