Add a sound for 'cancelling' ProgessNotification

This commit is contained in:
Jamie Taylor 2023-07-05 17:27:42 +09:00
parent 4ff4c3a12e
commit 6e2b7f433b
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C

View File

@ -4,6 +4,8 @@
using System;
using System.Threading;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
@ -122,6 +124,7 @@ namespace osu.Game.Overlays.Notifications
cancellationTokenSource.Cancel();
IconContent.FadeColour(ColourInfo.GradientVertical(Color4.Gray, Color4.Gray.Lighten(0.5f)), colour_fade_duration);
cancelSample?.Play();
loadingSpinner.Hide();
var icon = new SpriteIcon
@ -190,6 +193,8 @@ namespace osu.Game.Overlays.Notifications
private LoadingSpinner loadingSpinner = null!;
private Sample? cancelSample;
private readonly TextFlowContainer textDrawable;
public ProgressNotification()
@ -217,7 +222,7 @@ namespace osu.Game.Overlays.Notifications
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OsuColour colours, AudioManager audioManager)
{
colourQueued = colours.YellowDark;
colourActive = colours.Blue;
@ -236,6 +241,8 @@ namespace osu.Game.Overlays.Notifications
Size = new Vector2(loading_spinner_size),
}
});
cancelSample = audioManager.Samples.Get(@"UI/notification-cancel");
}
public override void Close(bool runFlingAnimation)