// 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; namespace osu.Game.Configuration { /// /// Stores global per-session statics. These will not be stored after exiting the game. /// public class SessionStatics : InMemoryConfigManager { protected override void InitialiseDefaults() => ResetValues(); public void ResetValues() { 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 { LoginOverlayDisplayed, MutedAudioNotificationShownOnce, LowBatteryNotificationShownOnce, /// /// Info about seasonal backgrounds available fetched from API - see . /// Value under this lookup can be null if there are no backgrounds available (or API is not reachable). /// SeasonalBackgrounds, /// /// The last playback time in milliseconds of a hover sample (from ). /// Used to debounce hover sounds game-wide to avoid volume saturation, especially in scrolling views with many UI controls like . /// LastHoverSoundPlaybackTime } }