mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 22:06:08 +08:00
General sorting improvements
This commit is contained in:
parent
6b3ecc28b8
commit
1cd93f79b3
@ -188,26 +188,18 @@ namespace osu.Game.Screens.Select
|
|||||||
public void Sort(FilterControl.SortMode mode) {
|
public void Sort(FilterControl.SortMode mode) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case FilterControl.SortMode.Artist:
|
case FilterControl.SortMode.Artist:
|
||||||
groups.Sort((x, y) =>
|
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist));
|
||||||
{
|
|
||||||
return string.Compare(x.BeatmapSet.Metadata.Artist, y.BeatmapSet.Metadata.Artist);
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case FilterControl.SortMode.Title:
|
case FilterControl.SortMode.Title:
|
||||||
groups.Sort((x, y) =>
|
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title));
|
||||||
{
|
|
||||||
return string.Compare(x.BeatmapSet.Metadata.Title, y.BeatmapSet.Metadata.Title);
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case FilterControl.SortMode.Author:
|
case FilterControl.SortMode.Author:
|
||||||
groups.Sort((x, y) =>
|
groups.Sort((x, y) => string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author));
|
||||||
{
|
|
||||||
return string.Compare(x.BeatmapSet.Metadata.Author, y.BeatmapSet.Metadata.Author);
|
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case FilterControl.SortMode.Difficulty:
|
case FilterControl.SortMode.Difficulty:
|
||||||
groups.Sort((x, y) =>
|
groups.Sort((x, y) =>
|
||||||
{
|
{
|
||||||
|
// TODO: replace with star rating once implemented
|
||||||
if (x.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty >
|
if (x.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty >
|
||||||
y.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty)
|
y.BeatmapSet.Beatmaps.First().BaseDifficulty.OverallDifficulty)
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user