From 9acea6eab0afa9d8262396e59accf58009a7f10f Mon Sep 17 00:00:00 2001 From: TocoToucan Date: Thu, 12 Apr 2018 19:33:30 +0300 Subject: [PATCH] Order beatmap difficulty icons correctly --- osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs | 2 +- osu.Game/Overlays/Direct/DirectPanel.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs index b09e151ebc1f..1781e606f9f3 100644 --- a/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs +++ b/osu.Game/Overlays/BeatmapSet/BeatmapPicker.cs @@ -44,7 +44,7 @@ public BeatmapSetInfo BeatmapSet Beatmap.Value = BeatmapSet.Beatmaps.First(); plays.Value = BeatmapSet.OnlineInfo.PlayCount; favourites.Value = BeatmapSet.OnlineInfo.FavouriteCount; - difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps.Select(b => new DifficultySelectorButton(b) + difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps.OrderBy(beatmap => beatmap.StarDifficulty).Select(b => new DifficultySelectorButton(b) { State = DifficultySelectorState.NotSelected, OnHovered = beatmap => diff --git a/osu.Game/Overlays/Direct/DirectPanel.cs b/osu.Game/Overlays/Direct/DirectPanel.cs index cba63b4a4994..6f6bf2d86801 100644 --- a/osu.Game/Overlays/Direct/DirectPanel.cs +++ b/osu.Game/Overlays/Direct/DirectPanel.cs @@ -2,6 +2,7 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using OpenTK; @@ -208,7 +209,7 @@ protected List GetDifficultyIcons() { var icons = new List(); - foreach (var b in SetInfo.Beatmaps) + foreach (var b in SetInfo.Beatmaps.OrderBy(beatmap => beatmap.StarDifficulty)) icons.Add(new DifficultyIcon(b)); return icons;