1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 23:12:55 +08:00

Adjust widths in statistic labels

This commit is contained in:
mk56-spn 2023-01-16 19:03:17 +01:00
parent 5a68b3062a
commit 83b10d61f4
2 changed files with 24 additions and 25 deletions

View File

@ -39,26 +39,11 @@ namespace osu.Game.Tests.Visual.SongSelect
}, },
}, },
new ScoreInfo new ScoreInfo
{
Position = 110000,
Rank = ScoreRank.X,
Accuracy = 1,
MaxCombo = 244,
TotalScore = 1707827,
Ruleset = new OsuRuleset().RulesetInfo,
User = new APIUser
{
Id = 4608074,
Username = @"Skycries",
CountryCode = CountryCode.BR,
},
},
new ScoreInfo
{ {
Position = 22333, Position = 22333,
Rank = ScoreRank.S, Rank = ScoreRank.S,
Accuracy = 1, Accuracy = 0.1f,
MaxCombo = 244, MaxCombo = 2404,
TotalScore = 1707827, TotalScore = 1707827,
Ruleset = new OsuRuleset().RulesetInfo, Ruleset = new OsuRuleset().RulesetInfo,
User = new APIUser User = new APIUser
@ -80,7 +65,7 @@ namespace osu.Game.Tests.Visual.SongSelect
Children = new Drawable[] Children = new Drawable[]
{ {
new LeaderBoardScoreV2(scores[0], 1), new LeaderBoardScoreV2(scores[0], 1),
new LeaderBoardScoreV2(scores[2], 3, true) new LeaderBoardScoreV2(scores[1], null, true)
} }
}; };
} }

View File

@ -40,7 +40,7 @@ namespace osu.Game.Online.Leaderboards
{ {
private readonly ScoreInfo score; private readonly ScoreInfo score;
private const int HEIGHT = 60; private const int height = 60;
private const int corner_radius = 10; private const int corner_radius = 10;
private const int transition_duration = 200; private const int transition_duration = 200;
@ -102,7 +102,7 @@ namespace osu.Game.Online.Leaderboards
Shear = shear; Shear = shear;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = HEIGHT; Height = height;
Child = content = new Container Child = content = new Container
{ {
Masking = true, Masking = true,
@ -176,11 +176,11 @@ namespace osu.Game.Online.Leaderboards
}) })
{ {
RelativeSizeAxes = Axes.None, RelativeSizeAxes = Axes.None,
Size = new Vector2(HEIGHT) Size = new Vector2(height)
}, },
new FillFlowContainer new FillFlowContainer
{ {
Position = new Vector2(HEIGHT + 9, 9), Position = new Vector2(height + 9, 9),
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Children = new Drawable[] Children = new Drawable[]
@ -217,6 +217,7 @@ namespace osu.Game.Online.Leaderboards
}, },
new FillFlowContainer new FillFlowContainer
{ {
Spacing = new Vector2(5, 0),
Shear = -shear, Shear = -shear,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
@ -346,6 +347,8 @@ namespace osu.Game.Online.Leaderboards
background.FadeColour(IsHovered ? backgroundColour.Lighten(0.2f) : backgroundColour, transition_duration, Easing.OutQuint); background.FadeColour(IsHovered ? backgroundColour.Lighten(0.2f) : backgroundColour, transition_duration, Easing.OutQuint);
} }
#region Subclasses
private partial class DateLabel : DrawableDate private partial class DateLabel : DrawableDate
{ {
public DateLabel(DateTimeOffset date) public DateLabel(DateTimeOffset date)
@ -374,13 +377,12 @@ namespace osu.Game.Online.Leaderboards
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours, OverlayColourProvider colourProvider) private void load(OsuColour colours, OverlayColourProvider colourProvider)
{ {
AutoSizeAxes = Axes.Both; AutoSizeAxes = Axes.Y;
OsuSpriteText value; OsuSpriteText value;
Child = content = new FillFlowContainer Child = content = new FillFlowContainer
{ {
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
Padding = new MarginPadding { Right = 25 },
Children = new Drawable[] Children = new Drawable[]
{ {
new OsuSpriteText new OsuSpriteText
@ -397,8 +399,18 @@ namespace osu.Game.Online.Leaderboards
} }
}; };
if (score.Combo == score.MaxCombo && statisticInfo.Name == EditorSetupStrings.ComboColourPrefix.ToUpper()) if (statisticInfo.Name == EditorSetupStrings.ComboColourPrefix.ToUpper())
{
Width = 45;
if (score.Combo != score.MaxCombo) return;
value.Colour = colours.Lime1; value.Colour = colours.Lime1;
return;
}
Width = statisticInfo.Name == BeatmapsetsStrings.ShowScoreboardHeadersAccuracy.ToUpper() ? 60 : 120;
} }
} }
@ -448,6 +460,8 @@ namespace osu.Game.Online.Leaderboards
} }
} }
#endregion
public MenuItem[] ContextMenuItems public MenuItem[] ContextMenuItems
{ {
get get