1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 01:27:29 +08:00

Fix dual specification of SuspensionHandler and move fields around slightly

This commit is contained in:
Dean Herbert 2021-10-07 23:40:47 +09:00
parent 9bf29503fb
commit da96cc73d8

View File

@ -62,8 +62,6 @@ namespace osu.Game.Screens.Play
private readonly Bindable<bool> samplePlaybackDisabled = new Bindable<bool>();
private AudioFilter lowPassFilter;
/// <summary>
/// Whether gameplay should pause when the game window focus is lost.
/// </summary>
@ -217,7 +215,7 @@ namespace osu.Game.Screens.Play
InternalChild = GameplayClockContainer = CreateGameplayClockContainer(Beatmap.Value, DrawableRuleset.GameplayStartTime);
AddInternal(screenSuspension = new ScreenSuspensionHandler(GameplayClockContainer));
AddInternal(lowPassFilter = new AudioFilter(audio.TrackMixer));
AddInternal(failLowPassFilter = new AudioFilter(audio.TrackMixer));
Score = CreateScore(playableBeatmap);
@ -228,8 +226,6 @@ namespace osu.Game.Screens.Play
dependencies.CacheAs(GameplayState = new GameplayState(playableBeatmap, ruleset, gameplayMods, Score));
AddInternal(screenSuspension = new ScreenSuspensionHandler(GameplayClockContainer));
var rulesetSkinProvider = new RulesetSkinProvidingContainer(ruleset, playableBeatmap, Beatmap.Value.Skin);
// load the skinning hierarchy first.
@ -774,6 +770,8 @@ namespace osu.Game.Screens.Play
private FailAnimation failAnimation;
private AudioFilter failLowPassFilter;
private bool onFail()
{
if (!CheckModsAllowFailure())
@ -788,7 +786,7 @@ namespace osu.Game.Screens.Play
if (PauseOverlay.State.Value == Visibility.Visible)
PauseOverlay.Hide();
lowPassFilter.CutoffTo(300, 2500, Easing.OutCubic);
failLowPassFilter.CutoffTo(300, 2500, Easing.OutCubic);
failAnimation.Start();
if (GameplayState.Mods.OfType<IApplicableFailOverride>().Any(m => m.RestartOnFail))
@ -801,7 +799,7 @@ namespace osu.Game.Screens.Play
private void onFailComplete()
{
GameplayClockContainer.Stop();
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
failLowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF);
FailOverlay.Retries = RestartCount;
FailOverlay.Show();