Allow determining a BeatmapDifficultyCache's bindable return's completion state via nullability

This commit is contained in:
Dean Herbert
2021-02-25 16:19:01 +09:00
parent 9f3ceb99eb
commit 03771ce8ec
5 changed files with 23 additions and 12 deletions

View File

@ -151,7 +151,7 @@ namespace osu.Game.Beatmaps.Drawables
this.mods = mods;
}
private IBindable<StarDifficulty> localStarDifficulty;
private IBindable<StarDifficulty?> localStarDifficulty;
[BackgroundDependencyLoader]
private void load()
@ -160,7 +160,11 @@ namespace osu.Game.Beatmaps.Drawables
localStarDifficulty = ruleset != null
? difficultyCache.GetBindableDifficulty(beatmap, ruleset, mods, difficultyCancellation.Token)
: difficultyCache.GetBindableDifficulty(beatmap, difficultyCancellation.Token);
localStarDifficulty.BindValueChanged(difficulty => StarDifficulty.Value = difficulty.NewValue);
localStarDifficulty.BindValueChanged(d =>
{
if (d.NewValue is StarDifficulty diff)
StarDifficulty.Value = diff;
});
}
protected override void Dispose(bool isDisposing)