1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 14:07:25 +08:00

Fix scores header is visible even with no scores (#5074)

Fix scores header is visible even with no scores
This commit is contained in:
Dean Herbert 2019-06-20 11:09:07 +09:00 committed by GitHub
commit a2ca798dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -39,8 +40,7 @@ namespace osu.Game.Tests.Visual.Online
{ {
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Both,
RelativeSizeAxes = Axes.X,
Width = 0.8f, Width = 0.8f,
Children = new Drawable[] Children = new Drawable[]
{ {
@ -173,7 +173,9 @@ namespace osu.Game.Tests.Visual.Online
s.Statistics.Add(HitResult.Miss, RNG.Next(2000)); s.Statistics.Add(HitResult.Miss, RNG.Next(2000));
} }
scoresContainer.Scores = scores; AddStep("Load all scores", () => scoresContainer.Scores = scores);
AddStep("Load null scores", () => scoresContainer.Scores = null);
AddStep("Load only one score", () => scoresContainer.Scores = new[] { scores.First() });
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -124,6 +124,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
loading = false; loading = false;
scoreTable.Scores = scores?.Count > 1 ? scores : new List<ScoreInfo>(); scoreTable.Scores = scores?.Count > 1 ? scores : new List<ScoreInfo>();
scoreTable.FadeTo(scores?.Count > 1 ? 1 : 0);
if (scores?.Any() == true) if (scores?.Any() == true)
{ {