1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:07:44 +08:00

Sort by difficulty and fix relationship

This commit is contained in:
Drew DeVault 2016-10-20 15:42:09 -04:00
parent 8d6431b35e
commit 42f8d19c73
3 changed files with 10 additions and 2 deletions

View File

@ -128,6 +128,11 @@ namespace osu.Game.Database
return connection.GetAllWithChildren<T>(filter, recursive);
}
public void GetChildren<T>(T item, bool recursive = true)
{
connection.GetChildren<T>(item, recursive);
}
readonly Type[] validTypes = new[]
{
typeof(BeatmapSetInfo),

View File

@ -217,12 +217,12 @@ namespace osu.Game.GameModes.Play
// TODO: Make these italic
new SpriteText
{
Text = this.beatmapSet.Metadata.TitleUnicode ?? this.beatmapSet.Metadata.Title,
Text = this.beatmapSet.Metadata.Title ?? this.beatmapSet.Metadata.TitleUnicode,
TextSize = 20
},
new SpriteText
{
Text = this.beatmapSet.Metadata.ArtistUnicode ?? this.beatmapSet.Metadata.Artist,
Text = this.beatmapSet.Metadata.Artist ?? this.beatmapSet.Metadata.ArtistUnicode,
TextSize = 16
},
new FlowContainer

View File

@ -59,6 +59,9 @@ namespace osu.Game.GameModes.Play
private void addBeatmapSet(BeatmapSetInfo beatmapSet)
{
beatmapSet = beatmaps.GetWithChildren<BeatmapSetInfo>(beatmapSet.BeatmapSetID);
beatmapSet.Beatmaps.ForEach(b => beatmaps.GetChildren(b));
beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.BaseDifficulty.OverallDifficulty)
.ToList();
var group = new BeatmapGroup(beatmapSet, beatmapResources, beatmapTextureResources);
group.SetSelected += selectBeatmapSet;
group.BeatmapSelected += selectBeatmap;