1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 23:05:37 +08:00

Move actual star updating to star rating display

This commit is contained in:
Joseph Madamba 2023-09-05 14:57:55 -07:00
parent 5becac6431
commit 676240928e
No known key found for this signature in database
GPG Key ID: 8B746C7BDDF0BD76
2 changed files with 6 additions and 8 deletions

View File

@ -63,12 +63,6 @@ namespace osu.Game.Tests.Visual.SongSelect
AddSliderStep("change star difficulty", 0, 11.9, 5.55, v =>
{
// Difficulty cache lookup is a pain in the ass to work with.
// This logic is ugly and needs to be reconsidered.
if (infoWedge.Info != null)
infoWedge.Info!.ActualStars.Value = v;
foreach (var hasCurrentValue in infoWedge.Info.ChildrenOfType<IHasCurrentValue<StarDifficulty>>())
hasCurrentValue.Current.Value = new StarDifficulty(v, 0);
});

View File

@ -186,7 +186,7 @@ namespace osu.Game.Screens.Select
{
// use actual stars as star counter has its own animation
starCounter.Current = (float)s.NewValue;
});
}, true);
});
});
@ -301,7 +301,6 @@ namespace osu.Game.Screens.Select
starDifficulty.BindValueChanged(s =>
{
starRatingDisplay.Current.Value = s.NewValue ?? default;
ActualStars.Value = s.NewValue?.Stars ?? 0;
// Don't roll the counter on initial display (but still allow it to roll on applying mods etc.)
if (!starRatingDisplay.IsPresent)
@ -309,6 +308,11 @@ namespace osu.Game.Screens.Select
starRatingDisplay.FadeIn(transition_duration);
});
starRatingDisplay.Current.BindValueChanged(s =>
{
ActualStars.Value = s.NewValue.Stars;
});
}
protected override void Dispose(bool isDisposing)