Skip to content

Commit

Permalink
Change OverallRanking to use a two-column layout similar to statist…
Browse files Browse the repository at this point in the history
…ics table
  • Loading branch information
peppy committed Jul 13, 2023
1 parent 1a7b00e commit b333945
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private IEnumerable<Drawable> createColumns()
Direction = FillDirection.Vertical
};

private partial class Spacer : CompositeDrawable
public partial class Spacer : CompositeDrawable
{
public Spacer()
{
Expand Down
49 changes: 37 additions & 12 deletions osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Solo;
using osuTK;

namespace osu.Game.Screens.Ranking.Statistics.User
{
Expand All @@ -18,7 +17,7 @@ public partial class OverallRanking : CompositeDrawable
public Bindable<SoloStatisticsUpdate?> StatisticsUpdate { get; } = new Bindable<SoloStatisticsUpdate?>();

private LoadingLayer loadingLayer = null!;
private FillFlowContainer content = null!;
private GridContainer content = null!;

[BackgroundDependencyLoader]
private void load()
Expand All @@ -33,21 +32,47 @@ private void load()
{
RelativeSizeAxes = Axes.Both,
},
content = new FillFlowContainer
content = new GridContainer
{
AlwaysPresent = true,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
Spacing = new Vector2(5),
Children = new Drawable[]
ColumnDimensions = new[]
{
new GlobalRankChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new AccuracyChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new MaximumComboChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new RankedScoreChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new TotalScoreChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new PerformancePointsChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } }
new Dimension(),
new Dimension(GridSizeMode.Absolute, 30),
new Dimension(),
},
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.Absolute, 10),
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.Absolute, 10),
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new Drawable[]
{
new GlobalRankChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new SimpleStatisticTable.Spacer(),
new PerformancePointsChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
},
new Drawable[] { },
new Drawable[]
{
new MaximumComboChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new SimpleStatisticTable.Spacer(),
new AccuracyChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
},
new Drawable[] { },
new Drawable[]
{
new RankedScoreChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
new SimpleStatisticTable.Spacer(),
new TotalScoreChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } },
}
}
}
};
Expand Down
5 changes: 3 additions & 2 deletions osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ private void load()
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Both,
AutoSizeAxes = Axes.X,
Height = StatisticItem.FONT_SIZE * 2,
Children = new Drawable[]
{
new FillFlowContainer
Expand Down Expand Up @@ -98,7 +99,7 @@ private void load()
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Font = OsuFont.Default.With(weight: FontWeight.Bold)
Font = OsuFont.Default.With(size: StatisticItem.FONT_SIZE, weight: FontWeight.Bold)
}
}
}
Expand Down

0 comments on commit b333945

Please sign in to comment.