mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 18:07:27 +09:00
Offline fallback and commenting
This commit is contained in:
parent
872551733f
commit
80949e89b9
@ -316,8 +316,8 @@ namespace osu.Game
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="beatmap">The beatmap to select.</param>
|
/// <param name="beatmap">The beatmap to select.</param>
|
||||||
/// <param name="difficultyCriteria">
|
/// <param name="difficultyCriteria">
|
||||||
/// Optional predicate used to try and find a difficulty to select.
|
/// Optional predicate used to filter which difficulties to select.
|
||||||
/// If omitted, this will try to present the first beatmap from the current ruleset.
|
/// If omitted, this will try to present a recommended beatmap from the current ruleset.
|
||||||
/// In case of failure the first difficulty of the set will be presented, ignoring the predicate.
|
/// In case of failure the first difficulty of the set will be presented, ignoring the predicate.
|
||||||
/// </param>
|
/// </param>
|
||||||
public void PresentBeatmap(BeatmapSetInfo beatmap, Predicate<BeatmapInfo> difficultyCriteria = null)
|
public void PresentBeatmap(BeatmapSetInfo beatmap, Predicate<BeatmapInfo> difficultyCriteria = null)
|
||||||
@ -351,7 +351,10 @@ namespace osu.Game
|
|||||||
if (!beatmaps.Any())
|
if (!beatmaps.Any())
|
||||||
beatmaps = databasedSet.Beatmaps;
|
beatmaps = databasedSet.Beatmaps;
|
||||||
|
|
||||||
var selection = DifficultyRecommender.GetRecommendedBeatmap(beatmaps);
|
var selection = DifficultyRecommender.GetRecommendedBeatmap(beatmaps) ?? (
|
||||||
|
// fallback if a difficulty can't be recommended, maybe we are offline
|
||||||
|
databasedSet.Beatmaps.Find(b => b.Ruleset.Equals(Ruleset.Value)) ?? databasedSet.Beatmaps.First()
|
||||||
|
);
|
||||||
|
|
||||||
Ruleset.Value = selection.Ruleset;
|
Ruleset.Value = selection.Ruleset;
|
||||||
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(selection);
|
Beatmap.Value = BeatmapManager.GetWorkingBeatmap(selection);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user