Check if StatisticItem.Name is null or empty

This commit is contained in:
naoei
2022-08-20 21:48:53 -04:00
parent 9386d352b8
commit 29ef1c8db8
3 changed files with 5 additions and 4 deletions

View File

@ -396,7 +396,7 @@ namespace osu.Game.Rulesets.Mania
{ {
Columns = new[] Columns = new[]
{ {
new StatisticItem(null, () => new SimpleStatisticTable(3, new SimpleStatisticItem[] new StatisticItem(string.Empty, () => new SimpleStatisticTable(3, new SimpleStatisticItem[]
{ {
new AverageHitError(score.HitEvents), new AverageHitError(score.HitEvents),
new UnstableRate(score.HitEvents) new UnstableRate(score.HitEvents)

View File

@ -317,7 +317,7 @@ namespace osu.Game.Rulesets.Osu
{ {
Columns = new[] Columns = new[]
{ {
new StatisticItem(null, () => new SimpleStatisticTable(3, new SimpleStatisticItem[] new StatisticItem(string.Empty, () => new SimpleStatisticTable(3, new SimpleStatisticItem[]
{ {
new AverageHitError(timedHitEvents), new AverageHitError(timedHitEvents),
new UnstableRate(timedHitEvents) new UnstableRate(timedHitEvents)

View File

@ -8,6 +8,7 @@ using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Localisation;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osuTK; using osuTK;
@ -59,7 +60,7 @@ namespace osu.Game.Screens.Ranking.Statistics
private static Drawable createHeader(StatisticItem item) private static Drawable createHeader(StatisticItem item)
{ {
if (item.Name == null) if (LocalisableString.IsNullOrEmpty(item.Name))
return Empty(); return Empty();
return new FillFlowContainer return new FillFlowContainer
@ -82,7 +83,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Text = item.Name.Value, Text = item.Name,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold),
} }
} }