mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 06:52:56 +08:00
Move cancellation out of condition
This commit is contained in:
parent
6b7f05740e
commit
76284a0f01
@ -188,12 +188,11 @@ namespace osu.Game.Screens.Select.Carousel
|
|||||||
if (Item.State.Value != CarouselItemState.Collapsed && Alpha == 0)
|
if (Item.State.Value != CarouselItemState.Collapsed && Alpha == 0)
|
||||||
starCounter.ReplayAnimation();
|
starCounter.ReplayAnimation();
|
||||||
|
|
||||||
if (Item.State.Value == CarouselItemState.Collapsed)
|
|
||||||
starDifficultyCancellationSource?.Cancel();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
starDifficultyCancellationSource?.Cancel();
|
starDifficultyCancellationSource?.Cancel();
|
||||||
|
|
||||||
|
// Only compute difficulty when the item is visible.
|
||||||
|
if (Item.State.Value != CarouselItemState.Collapsed)
|
||||||
|
{
|
||||||
// We've potentially cancelled the computation above so a new bindable is required.
|
// We've potentially cancelled the computation above so a new bindable is required.
|
||||||
starDifficultyBindable = difficultyManager.GetTrackedBindable(beatmap, (starDifficultyCancellationSource = new CancellationTokenSource()).Token);
|
starDifficultyBindable = difficultyManager.GetTrackedBindable(beatmap, (starDifficultyCancellationSource = new CancellationTokenSource()).Token);
|
||||||
starDifficultyBindable.BindValueChanged(d => starCounter.Current = (float)d.NewValue.Stars, true);
|
starDifficultyBindable.BindValueChanged(d => starCounter.Current = (float)d.NewValue.Stars, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user