Ensure PresentGameplay doesn't get stuck in loop if no beatmaps available

This commit is contained in:
Dean Herbert 2024-01-16 15:12:23 +09:00
parent 2fdbc501c2
commit 451ba1c861
No known key found for this signature in database

View File

@ -136,10 +136,15 @@ namespace osu.Game.Overlays.SkinEditor
globallyReenableBeatmapSkinSetting(); globallyReenableBeatmapSkinSetting();
} }
public void PresentGameplay() public void PresentGameplay() => presentGameplay(false);
private void presentGameplay(bool attemptedBeatmapSwitch)
{ {
performer?.PerformFromScreen(screen => performer?.PerformFromScreen(screen =>
{ {
if (State.Value != Visibility.Visible)
return;
if (beatmap.Value is DummyWorkingBeatmap) if (beatmap.Value is DummyWorkingBeatmap)
{ {
// presume we don't have anything good to play and just bail. // presume we don't have anything good to play and just bail.
@ -149,8 +154,12 @@ namespace osu.Game.Overlays.SkinEditor
// If we're playing the intro, switch away to another beatmap. // If we're playing the intro, switch away to another beatmap.
if (beatmap.Value.BeatmapSetInfo.Protected) if (beatmap.Value.BeatmapSetInfo.Protected)
{ {
music.NextTrack(); if (!attemptedBeatmapSwitch)
Schedule(PresentGameplay); {
music.NextTrack();
Schedule(() => presentGameplay(true));
}
return; return;
} }