Fix beatmap carousel interactions with deletion when not yet displayed

This commit is contained in:
Dean Herbert 2017-10-18 18:36:35 +09:00
parent 668f68dd63
commit a85de09c0f

View File

@ -33,10 +33,7 @@ namespace osu.Game.Screens.Select
public IEnumerable<BeatmapSetInfo> Beatmaps public IEnumerable<BeatmapSetInfo> Beatmaps
{ {
get get { return groups.Select(g => g.BeatmapSet); }
{
return groups.Select(g => g.BeatmapSet);
}
set set
{ {
@ -99,13 +96,11 @@ namespace osu.Game.Screens.Select
} }
public void AddBeatmap(BeatmapSetInfo beatmapSet) public void AddBeatmap(BeatmapSetInfo beatmapSet)
{
Schedule(() =>
{ {
var group = createGroup(beatmapSet); var group = createGroup(beatmapSet);
//for the time being, let's completely load the difficulty panels in the background.
//this likely won't scale so well, but allows us to completely async the loading flow.
Schedule(delegate
{
addGroup(group); addGroup(group);
computeYPositions(); computeYPositions();
if (selectedGroup == null) if (selectedGroup == null)
@ -113,7 +108,10 @@ namespace osu.Game.Screens.Select
}); });
} }
public void RemoveBeatmap(BeatmapSetInfo beatmapSet) => removeGroup(groups.Find(b => b.BeatmapSet.ID == beatmapSet.ID)); public void RemoveBeatmap(BeatmapSetInfo beatmapSet)
{
Schedule(() => removeGroup(groups.Find(b => b.BeatmapSet.ID == beatmapSet.ID)));
}
internal void UpdateBeatmap(BeatmapInfo beatmap) internal void UpdateBeatmap(BeatmapInfo beatmap)
{ {