mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 08:27:49 +08:00
Ensure PresentGameplay
doesn't get stuck in loop if no beatmaps available
This commit is contained in:
parent
2fdbc501c2
commit
451ba1c861
@ -136,10 +136,15 @@ namespace osu.Game.Overlays.SkinEditor
|
||||
globallyReenableBeatmapSkinSetting();
|
||||
}
|
||||
|
||||
public void PresentGameplay()
|
||||
public void PresentGameplay() => presentGameplay(false);
|
||||
|
||||
private void presentGameplay(bool attemptedBeatmapSwitch)
|
||||
{
|
||||
performer?.PerformFromScreen(screen =>
|
||||
{
|
||||
if (State.Value != Visibility.Visible)
|
||||
return;
|
||||
|
||||
if (beatmap.Value is DummyWorkingBeatmap)
|
||||
{
|
||||
// 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 (beatmap.Value.BeatmapSetInfo.Protected)
|
||||
{
|
||||
music.NextTrack();
|
||||
Schedule(PresentGameplay);
|
||||
if (!attemptedBeatmapSwitch)
|
||||
{
|
||||
music.NextTrack();
|
||||
Schedule(() => presentGameplay(true));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user