1
0
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:
Jamie Taylor 2021-10-07 14:15:47 +09:00
parent 5c48340520
commit cc209f0f2d
No known key found for this signature in database
GPG Key ID: 2ACFA8B6370B8C8C

View File

@ -16,6 +16,7 @@ using osu.Framework.Input.Events;
using osu.Framework.Logging; using osu.Framework.Logging;
using osu.Framework.Screens; using osu.Framework.Screens;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.Audio.Effects;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
@ -62,6 +63,8 @@ namespace osu.Game.Screens.Play
private readonly Bindable<bool> samplePlaybackDisabled = new Bindable<bool>(); private readonly Bindable<bool> samplePlaybackDisabled = new Bindable<bool>();
private Filter lpFilter;
/// <summary> /// <summary>
/// Whether gameplay should pause when the game window focus is lost. /// Whether gameplay should pause when the game window focus is lost.
/// </summary> /// </summary>
@ -227,6 +230,7 @@ namespace osu.Game.Screens.Play
AddInternal(GameplayBeatmap = new GameplayBeatmap(playableBeatmap)); AddInternal(GameplayBeatmap = new GameplayBeatmap(playableBeatmap));
AddInternal(screenSuspension = new ScreenSuspensionHandler(GameplayClockContainer)); AddInternal(screenSuspension = new ScreenSuspensionHandler(GameplayClockContainer));
AddInternal(lpFilter = new Filter(audio.TrackMixer));
dependencies.CacheAs(GameplayBeatmap); dependencies.CacheAs(GameplayBeatmap);
@ -788,6 +792,7 @@ namespace osu.Game.Screens.Play
if (PauseOverlay.State.Value == Visibility.Visible) if (PauseOverlay.State.Value == Visibility.Visible)
PauseOverlay.Hide(); PauseOverlay.Hide();
lpFilter.CutoffTo(300, 2500, Easing.OutCubic);
failAnimation.Start(); failAnimation.Start();
if (Mods.Value.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail)) if (Mods.Value.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
@ -800,6 +805,7 @@ namespace osu.Game.Screens.Play
private void onFailComplete() private void onFailComplete()
{ {
GameplayClockContainer.Stop(); GameplayClockContainer.Stop();
lpFilter.CutoffTo(lpFilter.MaxCutoff);
FailOverlay.Retries = RestartCount; FailOverlay.Retries = RestartCount;
FailOverlay.Show(); FailOverlay.Show();