diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 620b026060..30ba2bfe6d 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -62,8 +62,6 @@ public abstract class Player : ScreenWithBeatmapBackground, ISamplePlaybackDisab private readonly Bindable samplePlaybackDisabled = new Bindable(); - private AudioFilter lowPassFilter; - /// /// Whether gameplay should pause when the game window focus is lost. /// @@ -217,7 +215,7 @@ private void load(AudioManager audio, OsuConfigManager config, OsuGameBase game) 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 @@ private void load(AudioManager audio, OsuConfigManager config, OsuGameBase game) 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 @@ private void progressToResults(bool withDelay) private FailAnimation failAnimation; + private AudioFilter failLowPassFilter; + private bool onFail() { if (!CheckModsAllowFailure()) @@ -788,7 +786,7 @@ private bool onFail() 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().Any(m => m.RestartOnFail)) @@ -801,7 +799,7 @@ private bool onFail() private void onFailComplete() { GameplayClockContainer.Stop(); - lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF); + failLowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF); FailOverlay.Retries = RestartCount; FailOverlay.Show();