diff --git a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs index 61cacee45f..803facae04 100644 --- a/osu.Game/Graphics/UserInterface/HoverClickSounds.cs +++ b/osu.Game/Graphics/UserInterface/HoverClickSounds.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Linq; @@ -7,7 +7,6 @@ using osu.Framework.Audio; using osu.Framework.Audio.Sample; using osu.Framework.Extensions; using osu.Framework.Input.Events; -using osu.Framework.Threading; using osuTK.Input; namespace osu.Game.Graphics.UserInterface @@ -21,11 +20,6 @@ namespace osu.Game.Graphics.UserInterface private SampleChannel sampleClick; private readonly MouseButton[] buttons; - /// - /// Length of debounce for click sound playback, in milliseconds. Default is 0ms. - /// - public double ClickDebounceTime { get; set; } - /// /// a container which plays sounds on hover and click for any specified s. /// @@ -40,19 +34,10 @@ namespace osu.Game.Graphics.UserInterface this.buttons = buttons ?? new[] { MouseButton.Left }; } - private ScheduledDelegate playDelegate; - protected override bool OnClick(ClickEvent e) { - playDelegate?.Cancel(); - if (buttons.Contains(e.Button) && Contains(e.ScreenSpaceMousePosition)) - { - if (ClickDebounceTime <= 0) - sampleClick?.Play(); - else - playDelegate = Scheduler.AddDelayed(() => sampleClick?.Play(), ClickDebounceTime); - } + sampleClick?.Play(); return base.OnClick(e); }