Split click and hover and disable click debounce

This commit is contained in:
phosphene47
2019-11-28 00:44:01 +11:00
parent d4afea0b5e
commit 786fb9ede3
2 changed files with 11 additions and 6 deletions

View File

@ -22,9 +22,9 @@ namespace osu.Game.Graphics.UserInterface
private SampleChannel sampleHover;
/// <summary>
/// Length of debounce for sound playback, in milliseconds. Default is 50ms.
/// Length of debounce for hover sound playback, in milliseconds. Default is 50ms.
/// </summary>
public double DebounceTime { get; set; } = 50;
public double HoverDebounceTime { get; set; } = 50;
protected readonly HoverSampleSet SampleSet;
@ -40,10 +40,10 @@ namespace osu.Game.Graphics.UserInterface
{
playDelegate?.Cancel();
if (DebounceTime <= 0)
if (HoverDebounceTime <= 0)
sampleHover?.Play();
else
playDelegate = Scheduler.AddDelayed(() => sampleHover?.Play(), DebounceTime);
playDelegate = Scheduler.AddDelayed(() => sampleHover?.Play(), HoverDebounceTime);
return base.OnHover(e);
}