Move checks out of PopIn()

This commit is contained in:
Henry Lin 2022-01-20 08:39:33 +08:00
parent dd42c89260
commit 261fae6873
2 changed files with 4 additions and 7 deletions

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using System.Linq;
using System.Threading; using System.Threading;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
@ -50,7 +51,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
private void setPerformanceValue(PerformanceBreakdown breakdown) private void setPerformanceValue(PerformanceBreakdown breakdown)
{ {
if (breakdown != null) // Don't display the tooltip if "Total" is the only item
if (breakdown != null && breakdown.Performance.GetAttributesForDisplay().Count() > 1)
{ {
TooltipContent = breakdown; TooltipContent = breakdown;
performance.Value = (int)Math.Round(breakdown.Performance.Total, MidpointRounding.AwayFromZero); performance.Value = (int)Math.Round(breakdown.Performance.Total, MidpointRounding.AwayFromZero);

View File

@ -56,12 +56,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
textColour = colours.BlueLighter; textColour = colours.BlueLighter;
} }
protected override void PopIn() protected override void PopIn() => this.FadeIn(200, Easing.OutQuint);
{
// Don't display the tooltip if "Total" is the only item
if (currentPerformance.Performance.GetAttributesForDisplay().Count() > 1)
this.FadeIn(200, Easing.OutQuint);
}
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint); protected override void PopOut() => this.FadeOut(200, Easing.OutQuint);