1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00
osu-lazer/osu.Game/Configuration/SessionStatics.cs

44 lines
1.7 KiB
C#
Raw Normal View History

2019-09-23 13:15:27 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Overlays;
2019-09-23 13:15:27 +08:00
namespace osu.Game.Configuration
{
2019-09-28 20:21:51 +08:00
/// <summary>
/// Stores global per-session statics. These will not be stored after exiting the game.
/// </summary>
public class SessionStatics : InMemoryConfigManager<Static>
2019-09-23 13:15:27 +08:00
{
2019-09-25 06:25:05 +08:00
protected override void InitialiseDefaults()
2019-09-23 13:15:27 +08:00
{
SetDefault(Static.LoginOverlayDisplayed, false);
SetDefault(Static.MutedAudioNotificationShownOnce, false);
SetDefault(Static.LowBatteryNotificationShownOnce, false);
SetDefault(Static.LastHoverSoundPlaybackTime, (double?)null);
SetDefault<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
2019-09-23 13:15:27 +08:00
}
}
2019-09-28 20:21:51 +08:00
public enum Static
2019-09-23 13:15:27 +08:00
{
LoginOverlayDisplayed,
MutedAudioNotificationShownOnce,
LowBatteryNotificationShownOnce,
/// <summary>
/// Info about seasonal backgrounds available fetched from API - see <see cref="APISeasonalBackgrounds"/>.
/// Value under this lookup can be <c>null</c> if there are no backgrounds available (or API is not reachable).
/// </summary>
2020-10-31 02:55:17 +08:00
SeasonalBackgrounds,
/// <summary>
/// The last playback time in milliseconds of a hover sample (from <see cref="HoverSounds"/>).
/// Used to debounce hover sounds game-wide to avoid volume saturation, especially in scrolling views with many UI controls like <see cref="SettingsOverlay"/>.
/// </summary>
LastHoverSoundPlaybackTime
2019-09-23 13:15:27 +08:00
}
}