mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 14:12:56 +08:00
Add filter effect to fail sequence
This commit is contained in:
parent
5c48340520
commit
cc209f0f2d
@ -16,6 +16,7 @@ using osu.Framework.Input.Events;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Screens;
|
||||
using osu.Framework.Threading;
|
||||
using osu.Game.Audio.Effects;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Graphics.Containers;
|
||||
@ -62,6 +63,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private readonly Bindable<bool> samplePlaybackDisabled = new Bindable<bool>();
|
||||
|
||||
private Filter lpFilter;
|
||||
|
||||
/// <summary>
|
||||
/// Whether gameplay should pause when the game window focus is lost.
|
||||
/// </summary>
|
||||
@ -227,6 +230,7 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
AddInternal(GameplayBeatmap = new GameplayBeatmap(playableBeatmap));
|
||||
AddInternal(screenSuspension = new ScreenSuspensionHandler(GameplayClockContainer));
|
||||
AddInternal(lpFilter = new Filter(audio.TrackMixer));
|
||||
|
||||
dependencies.CacheAs(GameplayBeatmap);
|
||||
|
||||
@ -788,6 +792,7 @@ namespace osu.Game.Screens.Play
|
||||
if (PauseOverlay.State.Value == Visibility.Visible)
|
||||
PauseOverlay.Hide();
|
||||
|
||||
lpFilter.CutoffTo(300, 2500, Easing.OutCubic);
|
||||
failAnimation.Start();
|
||||
|
||||
if (Mods.Value.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
|
||||
@ -800,6 +805,7 @@ namespace osu.Game.Screens.Play
|
||||
private void onFailComplete()
|
||||
{
|
||||
GameplayClockContainer.Stop();
|
||||
lpFilter.CutoffTo(lpFilter.MaxCutoff);
|
||||
|
||||
FailOverlay.Retries = RestartCount;
|
||||
FailOverlay.Show();
|
||||
|
Loading…
Reference in New Issue
Block a user