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

Add ability to sort by source in song select

This commit is contained in:
Joseph Madamba 2021-05-09 14:10:38 -07:00
parent 2bcf1ed306
commit 8964d51de9
3 changed files with 8 additions and 1 deletions

View File

@ -304,6 +304,7 @@ namespace osu.Game.Tests.Visual.SongSelect
AddStep(@"Sort by BPM", () => config.SetValue(OsuSetting.SongSelectSortingMode, SortMode.BPM));
AddStep(@"Sort by Length", () => config.SetValue(OsuSetting.SongSelectSortingMode, SortMode.Length));
AddStep(@"Sort by Difficulty", () => config.SetValue(OsuSetting.SongSelectSortingMode, SortMode.Difficulty));
AddStep(@"Sort by Source", () => config.SetValue(OsuSetting.SongSelectSortingMode, SortMode.Source));
}
[Test]

View File

@ -82,6 +82,9 @@ namespace osu.Game.Screens.Select.Carousel
case SortMode.Difficulty:
return compareUsingAggregateMax(otherSet, b => b.StarDifficulty);
case SortMode.Source:
return string.Compare(BeatmapSet.Metadata.Source, otherSet.BeatmapSet.Metadata.Source, StringComparison.OrdinalIgnoreCase);
}
}

View File

@ -29,6 +29,9 @@ namespace osu.Game.Screens.Select.Filter
RankAchieved,
[Description("Title")]
Title
Title,
[Description("Source")]
Source,
}
}