From 676240928ea9ebb2dc86a3504c5128fb0550042b Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 5 Sep 2023 14:57:55 -0700 Subject: [PATCH] Move actual star updating to star rating display --- .../Visual/SongSelect/TestSceneBeatmapInfoWedgeV2.cs | 6 ------ osu.Game/Screens/Select/BeatmapInfoWedgeV2.cs | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedgeV2.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedgeV2.cs index a7070f845e..a8484caf1c 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedgeV2.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapInfoWedgeV2.cs @@ -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>()) hasCurrentValue.Current.Value = new StarDifficulty(v, 0); }); diff --git a/osu.Game/Screens/Select/BeatmapInfoWedgeV2.cs b/osu.Game/Screens/Select/BeatmapInfoWedgeV2.cs index 52fe99d6b8..596f90827f 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedgeV2.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedgeV2.cs @@ -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)