Fix removal of the last one beatmap.

This commit is contained in:
Huo Yaoyuan
2017-03-14 04:59:44 +08:00
parent 14a22f032f
commit 3913a0a9ee
3 changed files with 25 additions and 14 deletions

View File

@ -210,7 +210,7 @@ namespace osu.Game.Overlays
}
}
};
this.beatmaps = beatmaps;
trackManager = osuGame.Audio.Track;
preferUnicode = config.GetBindable<bool>(OsuConfig.ShowUnicode);
@ -247,6 +247,8 @@ namespace osu.Game.Overlays
if (current.Track.HasCompleted && !current.Track.Looping) next();
}
else
playButton.Icon = FontAwesome.fa_play_circle_o;
}
private void preferUnicode_changed(object sender, EventArgs e)
@ -337,12 +339,16 @@ namespace osu.Game.Overlays
Task.Run(() =>
{
if (beatmap?.Beatmap == null)
//todo: we may need to display some default text here (currently in the constructor).
return;
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
{
title.Text = @"Nothing to play";
artist.Text = @"Nothing to play";
}
else
{
BeatmapMetadata metadata = beatmap.Beatmap.BeatmapInfo.Metadata;
title.Text = unicodeString(metadata.Title, metadata.TitleUnicode);
artist.Text = unicodeString(metadata.Artist, metadata.ArtistUnicode);
}
});
MusicControllerBackground newBackground;