Fix adjusting volume via settings playing tick samples twice

This commit is contained in:
Dean Herbert
2022-10-21 21:03:39 +09:00
parent 4803f606c2
commit 447d420c99
2 changed files with 20 additions and 3 deletions

View File

@ -44,6 +44,8 @@ namespace osu.Game.Graphics.UserInterface
public virtual LocalisableString TooltipText { get; private set; }
public bool PlaySamplesOnAdjust { get; set; } = true;
/// <summary>
/// Whether to format the tooltip as a percentage or the actual value.
/// </summary>
@ -187,6 +189,9 @@ namespace osu.Game.Graphics.UserInterface
private void playSample(T value)
{
if (!PlaySamplesOnAdjust)
return;
if (Clock == null || Clock.CurrentTime - lastSampleTime <= 30)
return;