1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Follow slanted flow logic precedent in test

See `ModSelectOverlay` components.
This commit is contained in:
Joseph Madamba 2024-05-26 00:24:03 -07:00
parent 91fb5ed749
commit 8e14c24ee3
2 changed files with 14 additions and 14 deletions

View File

@ -63,17 +63,16 @@ namespace osu.Game.Tests.Visual.SongSelect
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Spacing = new Vector2(0f, 2f), Spacing = new Vector2(0f, 2f),
Shear = LeaderboardScoreV2.SHEAR
}, },
drawWidthText = new OsuSpriteText(), drawWidthText = new OsuSpriteText(),
}; };
int i = 0;
foreach (var scoreInfo in getTestScores()) foreach (var scoreInfo in getTestScores())
{ {
fillFlow.Add(new LeaderboardScoreV2(scoreInfo, scoreInfo.Position, scoreInfo.User.Id == 2) fillFlow.Add(new LeaderboardScoreV2(scoreInfo, scoreInfo.Position, scoreInfo.User.Id == 2)
{ {
Margin = new MarginPadding { Right = 10f * i, Left = -10f * i++ }, Shear = Vector2.Zero,
}); });
} }

View File

@ -65,7 +65,8 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
private Colour4 backgroundColour; private Colour4 backgroundColour;
private ColourInfo totalScoreBackgroundGradient; private ColourInfo totalScoreBackgroundGradient;
private static readonly Vector2 shear = new Vector2(0.15f, 0); // TODO: once https://github.com/ppy/osu/pull/28183 is merged, probably use OsuGame.SHEAR
public static readonly Vector2 SHEAR = new Vector2(0.15f, 0);
[Resolved] [Resolved]
private OverlayColourProvider colourProvider { get; set; } = null!; private OverlayColourProvider colourProvider { get; set; } = null!;
@ -112,7 +113,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
this.rank = rank; this.rank = rank;
this.isPersonalBest = isPersonalBest; this.isPersonalBest = isPersonalBest;
Shear = shear; Shear = SHEAR;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = height; Height = height;
} }
@ -245,7 +246,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
User = score.User, User = score.User,
Shear = -shear, Shear = -SHEAR,
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft, Origin = Anchor.BottomLeft,
Colour = ColourInfo.GradientHorizontal(Colour4.White.Opacity(0.5f), Colour4.FromHex(@"222A27").Opacity(1)), Colour = ColourInfo.GradientHorizontal(Colour4.White.Opacity(0.5f), Colour4.FromHex(@"222A27").Opacity(1)),
@ -276,7 +277,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Scale = new Vector2(1.1f), Scale = new Vector2(1.1f),
Shear = -shear, Shear = -SHEAR,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}) })
{ {
@ -316,7 +317,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
{ {
flagBadgeAndDateContainer = new FillFlowContainer flagBadgeAndDateContainer = new FillFlowContainer
{ {
Shear = -shear, Shear = -SHEAR,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(5), Spacing = new Vector2(5),
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
@ -340,7 +341,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
nameLabel = new TruncatingSpriteText nameLabel = new TruncatingSpriteText
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Shear = -shear, Shear = -SHEAR,
Text = user.Username, Text = user.Username,
Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold) Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold)
} }
@ -356,7 +357,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
Name = @"Statistics container", Name = @"Statistics container",
Padding = new MarginPadding { Right = 40 }, Padding = new MarginPadding { Right = 40 },
Spacing = new Vector2(25, 0), Spacing = new Vector2(25, 0),
Shear = -shear, Shear = -SHEAR,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
@ -414,7 +415,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
}, },
RankContainer = new Container RankContainer = new Container
{ {
Shear = -shear, Shear = -SHEAR,
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
@ -472,7 +473,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
UseFullGlyphHeight = false, UseFullGlyphHeight = false,
Shear = -shear, Shear = -SHEAR,
Current = scoreManager.GetBindableTotalScoreString(score), Current = scoreManager.GetBindableTotalScoreString(score),
Font = OsuFont.GetFont(size: 30, weight: FontWeight.Light), Font = OsuFont.GetFont(size: 30, weight: FontWeight.Light),
}, },
@ -480,7 +481,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
{ {
Anchor = Anchor.TopRight, Anchor = Anchor.TopRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
Shear = -shear, Shear = -SHEAR,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(2f, 0f), Spacing = new Vector2(2f, 0f),
@ -665,7 +666,7 @@ namespace osu.Game.Screens.SelectV2.Leaderboards
Child = new OsuSpriteText Child = new OsuSpriteText
{ {
Shear = -shear, Shear = -SHEAR,
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold, italics: true), Font = OsuFont.GetFont(size: 20, weight: FontWeight.SemiBold, italics: true),