Share hover sound debounce across all instances via SessionStatics

This commit is contained in:
Dean Herbert
2021-01-07 18:47:20 +09:00
parent 6620eadec3
commit 8f52a83b29
2 changed files with 26 additions and 12 deletions

View File

@ -1,7 +1,9 @@
// 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;
namespace osu.Game.Configuration
{
@ -14,6 +16,7 @@ namespace osu.Game.Configuration
{
Set(Static.LoginOverlayDisplayed, false);
Set(Static.MutedAudioNotificationShownOnce, false);
Set(Static.LastHoverSoundPlaybackTime, 0.0);
Set<APISeasonalBackgrounds>(Static.SeasonalBackgrounds, null);
}
}
@ -28,5 +31,11 @@ namespace osu.Game.Configuration
/// Value under this lookup can be <c>null</c> if there are no backgrounds available (or API is not reachable).
/// </summary>
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
}
}