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.
using System;
using System.Linq;
using System.Threading;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
@ -50,7 +51,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
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;
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;
}
protected override void PopIn()
{
// 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 PopIn() => this.FadeIn(200, Easing.OutQuint);
protected override void PopOut() => this.FadeOut(200, Easing.OutQuint);