mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 17:02:55 +08:00
Merge pull request #18752 from frenzibyte/cancel-metronome-on-pause
Cancel previous metronome sound playback on pause
This commit is contained in:
commit
6c0106f1e7
@ -4,6 +4,7 @@
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
using osu.Framework.Audio.Sample;
|
||||
@ -14,6 +15,7 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Colour;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Beatmaps.ControlPoints;
|
||||
@ -37,6 +39,9 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
private Sample clunk;
|
||||
|
||||
[CanBeNull]
|
||||
private ScheduledDelegate clunkDelegate;
|
||||
|
||||
[Resolved]
|
||||
private OverlayColourProvider overlayColourProvider { get; set; }
|
||||
|
||||
@ -258,6 +263,9 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
}
|
||||
|
||||
isSwinging = false;
|
||||
|
||||
clunkDelegate?.Cancel();
|
||||
clunkDelegate = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -283,7 +291,7 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
{
|
||||
stick.FlashColour(overlayColourProvider.Content1, beatLength, Easing.OutQuint);
|
||||
|
||||
Schedule(() =>
|
||||
clunkDelegate = Schedule(() =>
|
||||
{
|
||||
if (!EnableClicking)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user