1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 15:23:14 +08:00

Centralise font size specification for statistic items (and reduce slightly)

This commit is contained in:
Dean Herbert 2023-07-13 18:29:20 +09:00
parent 4f089eb5a5
commit d54cf63983
6 changed files with 20 additions and 15 deletions

View File

@ -154,7 +154,7 @@ namespace osu.Game.Screens.Ranking.Statistics
axisFlow = new Container axisFlow = new Container
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = axis_font_size, Height = StatisticItem.FONT_SIZE,
} }
}, },
}, },
@ -174,7 +174,7 @@ namespace osu.Game.Screens.Ranking.Statistics
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Text = "0", Text = "0",
Font = OsuFont.GetFont(size: axis_font_size, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE, weight: FontWeight.SemiBold)
}); });
for (int i = 1; i <= axis_points; i++) for (int i = 1; i <= axis_points; i++)
@ -191,7 +191,7 @@ namespace osu.Game.Screens.Ranking.Statistics
X = -position / 2, X = -position / 2,
Alpha = alpha, Alpha = alpha,
Text = axisValue.ToString("-0"), Text = axisValue.ToString("-0"),
Font = OsuFont.GetFont(size: axis_font_size, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE, weight: FontWeight.SemiBold)
}); });
axisFlow.Add(new OsuSpriteText axisFlow.Add(new OsuSpriteText
@ -202,7 +202,7 @@ namespace osu.Game.Screens.Ranking.Statistics
X = position / 2, X = position / 2,
Alpha = alpha, Alpha = alpha,
Text = axisValue.ToString("+0"), Text = axisValue.ToString("+0"),
Font = OsuFont.GetFont(size: axis_font_size, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE, weight: FontWeight.SemiBold)
}); });
} }
} }

View File

@ -97,7 +97,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Font = OsuFont.GetFont(weight: FontWeight.Regular, size: StatisticItem.FONT_SIZE),
Text = "Achieved PP", Text = "Achieved PP",
Colour = Color4Extensions.FromHex("#66FFCC") Colour = Color4Extensions.FromHex("#66FFCC")
}, },
@ -105,7 +105,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 14), Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: StatisticItem.FONT_SIZE),
Colour = Color4Extensions.FromHex("#66FFCC") Colour = Color4Extensions.FromHex("#66FFCC")
} }
}, },
@ -115,7 +115,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Font = OsuFont.GetFont(weight: FontWeight.Regular, size: StatisticItem.FONT_SIZE),
Text = "Maximum", Text = "Maximum",
Colour = OsuColour.Gray(0.7f) Colour = OsuColour.Gray(0.7f)
}, },
@ -123,7 +123,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Font = OsuFont.GetFont(weight: FontWeight.Regular, size: StatisticItem.FONT_SIZE),
Colour = OsuColour.Gray(0.7f) Colour = OsuColour.Gray(0.7f)
} }
} }
@ -208,7 +208,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Font = OsuFont.GetFont(weight: FontWeight.Regular, size: StatisticItem.FONT_SIZE),
Text = attribute.DisplayName, Text = attribute.DisplayName,
Colour = Colour4.White Colour = Colour4.White
}, },
@ -233,7 +233,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{ {
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 14), Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: StatisticItem.FONT_SIZE),
Text = percentage.ToLocalisableString("0%"), Text = percentage.ToLocalisableString("0%"),
Colour = Colour4.White Colour = Colour4.White
} }

View File

@ -44,13 +44,13 @@ namespace osu.Game.Screens.Ranking.Statistics
Text = Name, Text = Name,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 14) Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE)
}, },
value = new OsuSpriteText value = new OsuSpriteText
{ {
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold) Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE, weight: FontWeight.Bold)
} }
}); });
} }

View File

@ -70,7 +70,7 @@ namespace osu.Game.Screens.Ranking.Statistics
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Text = item.Name, Text = item.Name,
Font = OsuFont.GetFont(size: 14, weight: FontWeight.SemiBold), Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE, weight: FontWeight.SemiBold),
} }
} }
}; };

View File

@ -12,6 +12,11 @@ namespace osu.Game.Screens.Ranking.Statistics
/// </summary> /// </summary>
public class StatisticItem public class StatisticItem
{ {
/// <summary>
/// The recommended font size to use in statistic items to make sure they match others.
/// </summary>
public const float FONT_SIZE = 13;
/// <summary> /// <summary>
/// The name of this item. /// The name of this item.
/// </summary> /// </summary>

View File

@ -47,7 +47,7 @@ namespace osu.Game.Screens.Ranking.Statistics.User
new OsuSpriteText new OsuSpriteText
{ {
Text = Label, Text = Label,
Font = OsuFont.Default.With(size: 14) Font = OsuFont.Default.With(size: StatisticItem.FONT_SIZE)
}, },
new FillFlowContainer new FillFlowContainer
{ {
@ -90,7 +90,7 @@ namespace osu.Game.Screens.Ranking.Statistics.User
{ {
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Font = OsuFont.Default.With(size: 14, weight: FontWeight.Bold) Font = OsuFont.Default.With(size: StatisticItem.FONT_SIZE, weight: FontWeight.Bold)
}, },
} }
}, },