mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Fix test failures
This commit is contained in:
parent
b9fd1f52df
commit
6f947cacbd
@ -33,6 +33,8 @@ namespace osu.Game.Screens.Play
|
||||
private readonly DrawableRuleset drawableRuleset;
|
||||
private readonly BindableDouble trackFreq = new BindableDouble(1);
|
||||
|
||||
private Container filters;
|
||||
|
||||
private Box failFlash;
|
||||
|
||||
private Track track;
|
||||
@ -66,8 +68,14 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
failLowPassFilter = new AudioFilter(audio.TrackMixer),
|
||||
failHighPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass),
|
||||
filters = new Container
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
failLowPassFilter = new AudioFilter(audio.TrackMixer),
|
||||
failHighPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass),
|
||||
},
|
||||
},
|
||||
Content,
|
||||
failFlash = new Box
|
||||
{
|
||||
@ -122,6 +130,14 @@ namespace osu.Game.Screens.Play
|
||||
Content.FadeColour(Color4.Gray, duration);
|
||||
}
|
||||
|
||||
public void RemoveFilters()
|
||||
{
|
||||
RemoveInternal(filters);
|
||||
filters.Dispose();
|
||||
|
||||
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
@ -172,7 +188,7 @@ namespace osu.Game.Screens.Play
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
track?.RemoveAdjustment(AdjustableProperty.Frequency, trackFreq);
|
||||
RemoveFilters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -965,7 +965,7 @@ namespace osu.Game.Screens.Play
|
||||
public override bool OnExiting(IScreen next)
|
||||
{
|
||||
screenSuspension?.RemoveAndDisposeImmediately();
|
||||
failAnimationLayer?.RemoveAndDisposeImmediately();
|
||||
failAnimationLayer?.RemoveFilters();
|
||||
|
||||
// if arriving here and the results screen preparation task hasn't run, it's safe to say the user has not completed the beatmap.
|
||||
if (prepareScoreForDisplayTask == null)
|
||||
|
Loading…
Reference in New Issue
Block a user