1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-19 05:49:52 +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
Unverified
@@ -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;