diff --git a/osu.Game/Beatmaps/BeatmapDifficultyCache.cs b/osu.Game/Beatmaps/BeatmapDifficultyCache.cs
index 5e468e975a..ef0fa36b16 100644
--- a/osu.Game/Beatmaps/BeatmapDifficultyCache.cs
+++ b/osu.Game/Beatmaps/BeatmapDifficultyCache.cs
@@ -64,13 +64,13 @@ namespace osu.Game.Beatmaps
{
base.LoadComplete();
- currentRuleset.BindValueChanged(_ => updateTrackedBindables());
+ currentRuleset.BindValueChanged(_ => Scheduler.AddOnce(updateTrackedBindables));
currentMods.BindValueChanged(mods =>
{
modSettingChangeTracker?.Dispose();
- updateTrackedBindables();
+ Scheduler.AddOnce(updateTrackedBindables);
modSettingChangeTracker = new ModSettingChangeTracker(mods.NewValue);
modSettingChangeTracker.SettingChanged += _ =>
@@ -89,7 +89,9 @@ namespace osu.Game.Beatmaps
/// A bindable that is updated to contain the star difficulty when it becomes available. Will be null while in an initial calculating state (but not during updates to ruleset and mods if a stale value is already propagated).
public IBindable GetBindableDifficulty(IBeatmapInfo beatmapInfo, CancellationToken cancellationToken = default)
{
- var bindable = createBindable(beatmapInfo, currentRuleset.Value, currentMods.Value, cancellationToken);
+ var bindable = new BindableStarDifficulty(beatmapInfo, cancellationToken);
+
+ updateBindable(bindable, currentRuleset.Value, currentMods.Value, cancellationToken);
lock (bindableUpdateLock)
trackedBindables.Add(bindable);
@@ -97,21 +99,6 @@ namespace osu.Game.Beatmaps
return bindable;
}
- ///
- /// Retrieves a bindable containing the star difficulty of a with a given and combination.
- ///
- ///
- /// The bindable will not update to follow the currently-selected ruleset and mods or its settings.
- ///
- /// The to get the difficulty of.
- /// The to get the difficulty with. If null, the 's ruleset is used.
- /// The s to get the difficulty with. If null, no mods will be assumed.
- /// An optional which stops updating the star difficulty for the given .
- /// A bindable that is updated to contain the star difficulty when it becomes available. Will be null while in an initial calculating state.
- public IBindable GetBindableDifficulty(IBeatmapInfo beatmapInfo, IRulesetInfo? rulesetInfo, IEnumerable? mods,
- CancellationToken cancellationToken = default)
- => createBindable(beatmapInfo, rulesetInfo, mods, cancellationToken);
-
///
/// Retrieves the difficulty of a .
///
@@ -200,22 +187,6 @@ namespace osu.Game.Beatmaps
}
}
- ///
- /// Creates a new and triggers an initial value update.
- ///
- /// The that star difficulty should correspond to.
- /// The initial to get the difficulty with.
- /// The initial s to get the difficulty with.
- /// An optional which stops updating the star difficulty for the given .
- /// The .
- private BindableStarDifficulty createBindable(IBeatmapInfo beatmapInfo, IRulesetInfo? initialRulesetInfo, IEnumerable? initialMods,
- CancellationToken cancellationToken)
- {
- var bindable = new BindableStarDifficulty(beatmapInfo, cancellationToken);
- updateBindable(bindable, initialRulesetInfo, initialMods, cancellationToken);
- return bindable;
- }
-
///
/// Updates the value of a with a given ruleset + mods.
///