mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Allow determining a BeatmapDifficultyCache's bindable return's completion state via nullability
This commit is contained in:
@ -137,7 +137,7 @@ namespace osu.Game.Scoring
|
||||
ScoringMode.BindValueChanged(onScoringModeChanged, true);
|
||||
}
|
||||
|
||||
private IBindable<StarDifficulty> difficultyBindable;
|
||||
private IBindable<StarDifficulty?> difficultyBindable;
|
||||
private CancellationTokenSource difficultyCancellationSource;
|
||||
|
||||
private void onScoringModeChanged(ValueChangedEvent<ScoringMode> mode)
|
||||
@ -168,7 +168,11 @@ namespace osu.Game.Scoring
|
||||
|
||||
// We can compute the max combo locally after the async beatmap difficulty computation.
|
||||
difficultyBindable = difficulties().GetBindableDifficulty(score.Beatmap, score.Ruleset, score.Mods, (difficultyCancellationSource = new CancellationTokenSource()).Token);
|
||||
difficultyBindable.BindValueChanged(d => updateScore(d.NewValue.MaxCombo), true);
|
||||
difficultyBindable.BindValueChanged(d =>
|
||||
{
|
||||
if (d.NewValue is StarDifficulty diff)
|
||||
updateScore(diff.MaxCombo);
|
||||
}, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user