mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Add sorting by Length
This commit is contained in:
@ -47,6 +47,13 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
if (ruleset != 0) return ruleset;
|
||||
|
||||
return Beatmap.StarDifficulty.CompareTo(otherBeatmap.Beatmap.StarDifficulty);
|
||||
|
||||
case SortMode.Length:
|
||||
// Length comparing must be in seconds
|
||||
if (TimeSpan.FromMilliseconds(Beatmap.OnlineInfo.Length).Seconds != TimeSpan.FromMilliseconds(otherBeatmap.Beatmap.OnlineInfo.Length).Seconds)
|
||||
return Beatmap.OnlineInfo.Length.CompareTo(otherBeatmap.Beatmap.OnlineInfo.Length);
|
||||
|
||||
goto case SortMode.Difficulty;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,9 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
case SortMode.BPM:
|
||||
return BeatmapSet.OnlineInfo.BPM.CompareTo(otherSet.BeatmapSet.OnlineInfo.BPM);
|
||||
|
||||
case SortMode.Length:
|
||||
return BeatmapSet.MaxLength.CompareTo(otherSet.BeatmapSet.MaxLength);
|
||||
|
||||
case SortMode.Difficulty:
|
||||
return BeatmapSet.MaxStarDifficulty.CompareTo(otherSet.BeatmapSet.MaxStarDifficulty);
|
||||
}
|
||||
|
Reference in New Issue
Block a user