Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp results screen statistics display #24153

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4f4c481
Fix timing distribution graph sometimes not displaying correctly
peppy Jul 12, 2023
e2b5abd
Split bar drawable creation into own method
peppy Jul 13, 2023
21f26f9
Fix graph breaking when resized vertically
peppy Jul 13, 2023
1d62a04
Fix animation restarting unexpectedly
peppy Jul 13, 2023
12e8ac0
Merge branch 'master' into fix-hit-distro-code-quality
peppy Jul 13, 2023
c5dec37
Ensure `PerformanceBreakdown` pieces cannot be null
peppy Jun 28, 2023
890d542
Change order and test population in `TestSceneStatisticsPanel` to giv…
peppy Jun 28, 2023
27fad54
Remove more `GridContainer` nonsense
peppy Jun 28, 2023
deb160c
Show online stats on `TestSceneStatisticsPanel`
peppy Jun 28, 2023
53eb09f
Refactor results screen to use a stable grid layout
peppy Jul 7, 2023
4b229dc
Add background to statistics items
peppy Jul 7, 2023
d27b66c
Switch back to two-column tabular display and readjust height
peppy Jul 7, 2023
2cfe179
Add missing header for statistics table
peppy Jul 7, 2023
07fbaa5
Rename `StatisticContainer` to `StatisticItemContainer`
peppy Jul 7, 2023
5de07b5
Adjust metrics of `OverallRanking`
peppy Jul 7, 2023
65de301
Adjust metrics of `PerformanceBreakdown`
peppy Jul 7, 2023
2ce76dd
Adjust item backgrounds to match close to the rest of the results screen
peppy Jul 7, 2023
b323ae5
Adjust metrics of `AccuracyHeatmap`
peppy Jul 7, 2023
48c1771
Centralise font size specification for statistic items (and reduce sl…
peppy Jul 7, 2023
3d30eee
Adjust metrics of `HitEventTimingDistributionGraph`
peppy Jul 13, 2023
169bd3d
Ensure content is centered in layout
peppy Jul 12, 2023
cf9c757
Add full statistics score to `TestSceneResultsScreen`
peppy Jul 12, 2023
96343c7
Fix test regression
peppy Jul 12, 2023
7021340
Reorder tests for testability
peppy Jul 12, 2023
e8fa872
Add actual statistics changes to better visualise layout
peppy Jul 12, 2023
661dc66
Adjust metrics of `OverallRanking` to fit better
peppy Jul 12, 2023
9fcc1da
Add more padding around header
peppy Jul 12, 2023
1d6ed3b
Reduce application of UI scale at results screen to make things fit b…
peppy Jul 13, 2023
8f21b1f
Split out constant for usable statistics item space
peppy Jul 13, 2023
4bea4be
Adjust metrics for larger display usage
peppy Jul 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Centralise font size specification for statistic items (and reduce sl…
…ightly)
  • Loading branch information
peppy committed Jul 13, 2023
commit 48c177128c3975f8398302d358aede1bce2a78c0
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ private void createBarDrawables()

Container axisFlow;

const float axis_font_size = 12;

InternalChild = new GridContainer
{
Expand All @@ -154,7 +153,7 @@ private void createBarDrawables()
axisFlow = new Container
{
RelativeSizeAxes = Axes.X,
Height = axis_font_size,
Height = StatisticItem.FONT_SIZE,
}
},
},
Expand All @@ -174,7 +173,7 @@ private void createBarDrawables()
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++)
Expand All @@ -191,7 +190,7 @@ private void createBarDrawables()
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
Expand All @@ -202,7 +201,7 @@ private void createBarDrawables()
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)
});
}
}
Expand Down
12 changes: 6 additions & 6 deletions osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ private void load()
{
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")
},
achievedPerformance = new OsuSpriteText
{
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")
}
},
Expand All @@ -115,15 +115,15 @@ private void load()
{
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)
},
maximumPerformance = new OsuSpriteText
{
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)
}
}
Expand Down Expand Up @@ -208,7 +208,7 @@ private Drawable[] createAttributeRow(PerformanceDisplayAttribute attribute, Per
{
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
},
Expand All @@ -233,7 +233,7 @@ private Drawable[] createAttributeRow(PerformanceDisplayAttribute attribute, Per
{
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
}
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ protected SimpleStatisticItem(string name)
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)
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ private partial class Spacer : CompositeDrawable
public Spacer()
{
RelativeSizeAxes = Axes.Both;
Padding = new MarginPadding { Vertical = 4 };

InternalChild = new CircularContainer
{
Expand Down
5 changes: 5 additions & 0 deletions osu.Game/Screens/Ranking/Statistics/StatisticItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static Drawable createHeader(StatisticItem item)
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),
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private void load()
new OsuSpriteText
{
Text = Label,
Font = OsuFont.Default.With(size: 14)
Font = OsuFont.Default.With(size: StatisticItem.FONT_SIZE)
},
new FillFlowContainer
{
Expand Down Expand Up @@ -90,7 +90,7 @@ private void load()
{
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)
},
}
},
Expand Down