diff --git a/osu.Game.Tests/Visual/Gameplay/TestScenePerformancePointsCounter.cs b/osu.Game.Tests/Visual/Gameplay/TestScenePerformancePointsCounter.cs index 26f4bda171..c7d2204de2 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestScenePerformancePointsCounter.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestScenePerformancePointsCounter.cs @@ -68,6 +68,7 @@ namespace osu.Game.Tests.Visual.Gameplay AddRepeatStep("Add judgement", applyOneJudgement, 10); AddUntilStep("counter non-zero", () => counter.Current.Value > 0); + AddUntilStep("counter opaque", () => counter.Child.Alpha == 1); AddStep("Revert judgement", () => { diff --git a/osu.Game/Screens/Play/HUD/PerformancePointsCounter.cs b/osu.Game/Screens/Play/HUD/PerformancePointsCounter.cs index da821d76ad..9eac62fe73 100644 --- a/osu.Game/Screens/Play/HUD/PerformancePointsCounter.cs +++ b/osu.Game/Screens/Play/HUD/PerformancePointsCounter.cs @@ -38,6 +38,8 @@ namespace osu.Game.Screens.Play.HUD protected override double RollingDuration => 1000; + private const float alpha_when_invalid = 0.3f; + [CanBeNull] [Resolved(CanBeNull = true)] private ScoreProcessor scoreProcessor { get; set; } @@ -70,6 +72,7 @@ namespace osu.Game.Screens.Play.HUD .ContinueWith(r => Schedule(() => { timedAttributes = r.Result; + IsValid = true; if (lastJudgement != null) onNewJudgement(lastJudgement); }), TaskContinuationOptions.OnlyOnRanToCompletion); @@ -97,7 +100,7 @@ namespace osu.Game.Screens.Play.HUD return; isValid = value; - DrawableCount.FadeTo(isValid ? 1 : 0.3f, 1000, Easing.OutQuint); + DrawableCount.FadeTo(isValid ? 1 : alpha_when_invalid, 1000, Easing.OutQuint); } } @@ -133,7 +136,10 @@ namespace osu.Game.Screens.Play.HUD protected override LocalisableString FormatCount(int count) => count.ToString(@"D"); - protected override IHasText CreateText() => new TextComponent(); + protected override IHasText CreateText() => new TextComponent + { + Alpha = alpha_when_invalid + }; protected override void Dispose(bool isDisposing) {