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

Merge pull request #10146 from bdach/flaky-song-select-tests-v2

This commit is contained in:
Dean Herbert 2020-09-15 14:17:27 +09:00 committed by GitHub
commit 75d0797cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -517,6 +517,8 @@ namespace osu.Game.Screens.Select
FilterControl.Activate(); FilterControl.Activate();
ModSelect.SelectedMods.BindTo(selectedMods); ModSelect.SelectedMods.BindTo(selectedMods);
music.TrackChanged += ensureTrackLooping;
} }
private const double logo_transition = 250; private const double logo_transition = 250;
@ -568,6 +570,7 @@ namespace osu.Game.Screens.Select
BeatmapDetails.Refresh(); BeatmapDetails.Refresh();
music.CurrentTrack.Looping = true; music.CurrentTrack.Looping = true;
music.TrackChanged += ensureTrackLooping;
music.ResetTrackAdjustments(); music.ResetTrackAdjustments();
if (Beatmap != null && !Beatmap.Value.BeatmapSetInfo.DeletePending) if (Beatmap != null && !Beatmap.Value.BeatmapSetInfo.DeletePending)
@ -593,6 +596,7 @@ namespace osu.Game.Screens.Select
BeatmapOptions.Hide(); BeatmapOptions.Hide();
music.CurrentTrack.Looping = false; music.CurrentTrack.Looping = false;
music.TrackChanged -= ensureTrackLooping;
this.ScaleTo(1.1f, 250, Easing.InSine); this.ScaleTo(1.1f, 250, Easing.InSine);
@ -614,10 +618,14 @@ namespace osu.Game.Screens.Select
FilterControl.Deactivate(); FilterControl.Deactivate();
music.CurrentTrack.Looping = false; music.CurrentTrack.Looping = false;
music.TrackChanged -= ensureTrackLooping;
return false; return false;
} }
private void ensureTrackLooping(WorkingBeatmap beatmap, TrackChangeDirection changeDirection)
=> music.CurrentTrack.Looping = true;
public override bool OnBackButton() public override bool OnBackButton()
{ {
if (ModSelect.State.Value == Visibility.Visible) if (ModSelect.State.Value == Visibility.Visible)
@ -634,6 +642,7 @@ namespace osu.Game.Screens.Select
base.Dispose(isDisposing); base.Dispose(isDisposing);
decoupledRuleset.UnbindAll(); decoupledRuleset.UnbindAll();
music.TrackChanged -= ensureTrackLooping;
} }
/// <summary> /// <summary>
@ -653,8 +662,6 @@ namespace osu.Game.Screens.Select
beatmapInfoWedge.Beatmap = beatmap; beatmapInfoWedge.Beatmap = beatmap;
BeatmapDetails.Beatmap = beatmap; BeatmapDetails.Beatmap = beatmap;
music.CurrentTrack.Looping = true;
} }
private readonly WeakReference<ITrack> lastTrack = new WeakReference<ITrack>(null); private readonly WeakReference<ITrack> lastTrack = new WeakReference<ITrack>(null);