1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:07:52 +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
{
RelativeSizeAxes = Axes.X,
Height = axis_font_size,
Height = StatisticItem.FONT_SIZE,
}
},
},
@ -174,7 +174,7 @@ namespace osu.Game.Screens.Ranking.Statistics
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
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++)
@ -191,7 +191,7 @@ namespace osu.Game.Screens.Ranking.Statistics
X = -position / 2,
Alpha = alpha,
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
@ -202,7 +202,7 @@ namespace osu.Game.Screens.Ranking.Statistics
X = position / 2,
Alpha = alpha,
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,
Anchor = Anchor.CentreLeft,
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14),
Font = OsuFont.GetFont(weight: FontWeight.Regular, size: StatisticItem.FONT_SIZE),
Text = "Achieved PP",
Colour = Color4Extensions.FromHex("#66FFCC")
},
@ -105,7 +105,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{
Origin = 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")
}
},
@ -115,7 +115,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{
Origin = 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",
Colour = OsuColour.Gray(0.7f)
},
@ -123,7 +123,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{
Origin = 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)
}
}
@ -208,7 +208,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{
Origin = 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,
Colour = Colour4.White
},
@ -233,7 +233,7 @@ namespace osu.Game.Screens.Ranking.Statistics
{
Origin = 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%"),
Colour = Colour4.White
}

View File

@ -44,13 +44,13 @@ namespace osu.Game.Screens.Ranking.Statistics
Text = Name,
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Font = OsuFont.GetFont(size: 14)
Font = OsuFont.GetFont(size: StatisticItem.FONT_SIZE)
},
value = new OsuSpriteText
{
Anchor = 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,
Origin = Anchor.CentreLeft,
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>
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>
/// The name of this item.
/// </summary>

View File

@ -47,7 +47,7 @@ namespace osu.Game.Screens.Ranking.Statistics.User
new OsuSpriteText
{
Text = Label,
Font = OsuFont.Default.With(size: 14)
Font = OsuFont.Default.With(size: StatisticItem.FONT_SIZE)
},
new FillFlowContainer
{
@ -90,7 +90,7 @@ namespace osu.Game.Screens.Ranking.Statistics.User
{
Anchor = 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)
},
}
},