1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 04:13:00 +08:00

Merge pull request #18752 from frenzibyte/cancel-metronome-on-pause

Cancel previous metronome sound playback on pause
This commit is contained in:
Dean Herbert 2022-06-18 11:19:18 +09:00 committed by GitHub
commit 6c0106f1e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;