mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 11:37:28 +08:00
Add a sound for 'cancelling' ProgessNotification
This commit is contained in:
parent
4ff4c3a12e
commit
6e2b7f433b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user