mirror of
https://github.com/osukey/osukey.git
synced 2025-07-06 19:00:01 +09:00
Use BeatmapDifficultyCache.GetBindableDifficulty(...)
instead
This commit is contained in:
@ -55,12 +55,14 @@ namespace osu.Game.Screens.Play
|
|||||||
this.mods.BindTo(mods);
|
this.mods.BindTo(mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IBindable<StarDifficulty?> starDifficulty;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(BeatmapDifficultyCache difficultyCache)
|
private void load(BeatmapDifficultyCache difficultyCache)
|
||||||
{
|
{
|
||||||
var metadata = beatmap.BeatmapInfo?.Metadata ?? new BeatmapMetadata();
|
StarRatingDisplay starRatingDisplay;
|
||||||
|
|
||||||
var starDifficulty = difficultyCache.GetDifficultyAsync(beatmap.BeatmapInfo, ruleset, mods.Value).Result;
|
var metadata = beatmap.BeatmapInfo?.Metadata ?? new BeatmapMetadata();
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -131,7 +133,7 @@ namespace osu.Game.Screens.Play
|
|||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
},
|
},
|
||||||
new StarRatingDisplay(starDifficulty)
|
starRatingDisplay = new StarRatingDisplay
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
@ -179,6 +181,13 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
starDifficulty = difficultyCache.GetBindableDifficulty(beatmap.BeatmapInfo);
|
||||||
|
starDifficulty.BindValueChanged(difficulty =>
|
||||||
|
{
|
||||||
|
if (difficulty.NewValue is StarDifficulty diff)
|
||||||
|
starRatingDisplay.Current.Value = diff;
|
||||||
|
}, true);
|
||||||
|
|
||||||
Loading = true;
|
Loading = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user