1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-27 17:03:21 +08:00

Only calculate recommended SR once

This commit is contained in:
Endrik Tombak 2020-11-21 14:09:32 +02:00
parent 944f3480c2
commit 6c5a6b42e5

View File

@ -69,8 +69,11 @@ namespace osu.Game.Screens.Select
return beatmap; return beatmap;
} }
private void calculateRecommendedDifficulties() private void calculateRecommendedDifficulties(bool onlyIfNoPreviousValues = false)
{ {
if (recommendedStarDifficulty.Any() && onlyIfNoPreviousValues)
return;
// only query API for built-in rulesets // only query API for built-in rulesets
rulesets.AvailableRulesets.Where(ruleset => ruleset.ID <= 3).ForEach(rulesetInfo => rulesets.AvailableRulesets.Where(ruleset => ruleset.ID <= 3).ForEach(rulesetInfo =>
{ {
@ -122,7 +125,7 @@ namespace osu.Game.Screens.Select
switch (state.NewValue) switch (state.NewValue)
{ {
case APIState.Online: case APIState.Online:
calculateRecommendedDifficulties(); calculateRecommendedDifficulties(true);
break; break;
} }
}); });