1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 09:02:58 +08:00

Improve song select startup time via better database querying. Also fix difficulty displays.

This commit is contained in:
Dean Herbert 2016-12-15 22:48:35 +09:00
parent ec7bbd231f
commit 8ce18e8986
2 changed files with 9 additions and 4 deletions

View File

@ -54,7 +54,7 @@ namespace osu.Game.Beatmaps.Drawables
}
}
public BeatmapGroup(WorkingBeatmap beatmap)
public BeatmapGroup(WorkingBeatmap beatmap, BeatmapSetInfo set = null)
{
this.beatmap = beatmap;

View File

@ -164,7 +164,7 @@ namespace osu.Game.Screens.Select
BeatmapInfo = carousel.SelectedGroup.SelectedPanel.Beatmap,
PreferredPlayMode = playMode.Value
};
player.Preload(Game, delegate
{
if (!Push(player))
@ -336,10 +336,15 @@ namespace osu.Game.Screens.Select
private void addBeatmapSet(BeatmapSetInfo beatmapSet, BaseGame game)
{
beatmapSet = database.GetWithChildren<BeatmapSetInfo>(beatmapSet.BeatmapSetID);
beatmapSet.Beatmaps.ForEach(b => database.GetChildren(b));
beatmapSet.Beatmaps.ForEach(b =>
{
database.GetChildren(b);
if (b.Metadata == null) b.Metadata = beatmapSet.Metadata;
});
beatmapSet.Beatmaps = beatmapSet.Beatmaps.OrderBy(b => b.BaseDifficulty.OverallDifficulty).ToList();
var beatmap = database.GetWorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault());
var beatmap = new WorkingBeatmap(beatmapSet.Beatmaps.FirstOrDefault(), beatmapSet, database);
var group = new BeatmapGroup(beatmap) { SelectionChanged = selectionChanged };