mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Allow determining a BeatmapDifficultyCache's bindable return's completion state via nullability
This commit is contained in:
@ -63,7 +63,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
[Resolved(CanBeNull = true)]
|
||||
private ManageCollectionsDialog manageCollectionsDialog { get; set; }
|
||||
|
||||
private IBindable<StarDifficulty> starDifficultyBindable;
|
||||
private IBindable<StarDifficulty?> starDifficultyBindable;
|
||||
private CancellationTokenSource starDifficultyCancellationSource;
|
||||
|
||||
public DrawableCarouselBeatmap(CarouselBeatmap panel)
|
||||
@ -217,7 +217,10 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
// We've potentially cancelled the computation above so a new bindable is required.
|
||||
starDifficultyBindable = difficultyCache.GetBindableDifficulty(beatmap, (starDifficultyCancellationSource = new CancellationTokenSource()).Token);
|
||||
starDifficultyBindable.BindValueChanged(d => starCounter.Current = (float)d.NewValue.Stars, true);
|
||||
starDifficultyBindable.BindValueChanged(d =>
|
||||
{
|
||||
starCounter.Current = (float)(d.NewValue?.Stars ?? 0);
|
||||
}, true);
|
||||
}
|
||||
|
||||
base.ApplyState();
|
||||
|
Reference in New Issue
Block a user