1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 14:12:56 +08:00

Merge branch 'master' into drawableflag-ctor

This commit is contained in:
Dean Herbert 2017-07-25 09:46:27 +09:00 committed by GitHub
commit b528568547
2 changed files with 9 additions and 2 deletions

View File

@ -18,10 +18,11 @@ using System.Threading.Tasks;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Game.Graphics.Containers;
namespace osu.Game.Screens.Select namespace osu.Game.Screens.Select
{ {
internal class BeatmapCarousel : ScrollContainer internal class BeatmapCarousel : OsuScrollContainer
{ {
public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap; public BeatmapInfo SelectedBeatmap => selectedPanel?.Beatmap;
@ -177,6 +178,9 @@ namespace osu.Game.Screens.Select
public void SelectNextRandom() public void SelectNextRandom()
{ {
if (groups.Count == 0)
return;
randomSelectedBeatmaps.Push(new KeyValuePair<BeatmapGroup, BeatmapPanel>(selectedGroup, selectedGroup.SelectedPanel)); randomSelectedBeatmaps.Push(new KeyValuePair<BeatmapGroup, BeatmapPanel>(selectedGroup, selectedGroup.SelectedPanel));
var visibleGroups = getVisibleGroups(); var visibleGroups = getVisibleGroups();
@ -310,6 +314,9 @@ namespace osu.Game.Screens.Select
private void removeGroup(BeatmapGroup group) private void removeGroup(BeatmapGroup group)
{ {
if (group == null)
return;
groups.Remove(group); groups.Remove(group);
panels.Remove(group.Header); panels.Remove(group.Header);
foreach (var p in group.BeatmapPanels) foreach (var p in group.BeatmapPanels)

View File

@ -384,7 +384,7 @@ namespace osu.Game.Screens.Select
private void promptDelete() private void promptDelete()
{ {
if (Beatmap != null) if (Beatmap != null && !Beatmap.IsDefault)
dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap)); dialogOverlay?.Push(new BeatmapDeleteDialog(Beatmap));
} }