mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 17:52:56 +08:00
Add debounce to sample playback
This commit is contained in:
parent
e33c1f9a41
commit
069ee6980f
@ -105,6 +105,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private readonly Bindable<RulesetInfo> decoupledRuleset = new Bindable<RulesetInfo>();
|
||||
|
||||
private double audioFeedbackLastPlaybackTime;
|
||||
|
||||
[Resolved]
|
||||
private MusicController music { get; set; }
|
||||
|
||||
@ -480,12 +482,14 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
if (beatmap != beatmapInfoPrevious)
|
||||
{
|
||||
if (beatmap != null && beatmapInfoPrevious != null)
|
||||
if (beatmap != null && beatmapInfoPrevious != null && Time.Current - audioFeedbackLastPlaybackTime >= 50)
|
||||
{
|
||||
if (beatmap.BeatmapSetInfoID == beatmapInfoPrevious.BeatmapSetInfoID)
|
||||
sampleChangeDifficulty.Play();
|
||||
else
|
||||
sampleChangeBeatmap.Play();
|
||||
|
||||
audioFeedbackLastPlaybackTime = Time.Current;
|
||||
}
|
||||
|
||||
beatmapInfoPrevious = beatmap;
|
||||
|
Loading…
Reference in New Issue
Block a user