Remove excessive selection updating

This commit is contained in:
David Zhao
2019-05-28 14:04:33 +09:00
parent 05c0df53dc
commit e59a00ac6e
2 changed files with 34 additions and 2 deletions

View File

@ -597,11 +597,17 @@ namespace osu.Game.Screens.Select
{
bindBindables();
// As a selection was already obtained, do not attempt to update the selected beatmap.
if (Carousel.SelectedBeatmapSet != null)
return;
// Attempt to select the current beatmap on the carousel, if it is valid to be selected.
if (!Beatmap.IsDefault && Beatmap.Value.BeatmapSetInfo?.DeletePending == false && Beatmap.Value.BeatmapSetInfo?.Protected == false
&& Carousel.SelectBeatmap(Beatmap.Value.BeatmapInfo, false))
return;
if (Carousel.SelectedBeatmapSet == null && !Carousel.SelectNextRandom())
// If the current active beatmap could not be selected, select a new random beatmap.
if (!Carousel.SelectNextRandom())
{
// in the case random selection failed, we want to trigger selectionChanged
// to show the dummy beatmap (we have nothing else to display).