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

@ -127,6 +127,11 @@ public List<T> GetAllWithChildren<T>(Expression<Func<T, bool>> filter = null,
{
return connection.GetAllWithChildren<T>(filter, recursive);
}
public void GetChildren<T>(T item, bool recursive = true)
{
connection.GetChildren<T>(item, recursive);
}
readonly Type[] validTypes = new[]
{

View File

@ -217,12 +217,12 @@ public BeatmapSetBox(BeatmapSetInfo beatmapSet, BeatmapResourceStore beatmapStor
// 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 @@ private void selectBeatmap(BeatmapSetInfo set, BeatmapInfo beatmap)
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;