From 0173543dcc2f2d639ba8ab74c3976c6a19d0baf0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Jun 2023 18:17:46 +0900 Subject: [PATCH 01/18] Change order and test population in `TestSceneStatisticsPanel` to give better visible results --- .../Visual/Ranking/TestSceneStatisticsPanel.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs index 67211a3b729d..69c9fcb637d5 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs @@ -30,19 +30,19 @@ namespace osu.Game.Tests.Visual.Ranking public partial class TestSceneStatisticsPanel : OsuTestScene { [Test] - public void TestScoreWithTimeStatistics() + public void TestScoreWithPositionStatistics() { var score = TestResources.CreateTestScoreInfo(); - score.HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(); + score.HitEvents = createPositionDistributedHitEvents(); loadPanel(score); } [Test] - public void TestScoreWithPositionStatistics() + public void TestScoreWithTimeStatistics() { var score = TestResources.CreateTestScoreInfo(); - score.HitEvents = createPositionDistributedHitEvents(); + score.HitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(); loadPanel(score); } @@ -89,18 +89,19 @@ private void loadPanel(ScoreInfo score) => AddStep("load panel", () => private static List createPositionDistributedHitEvents() { - var hitEvents = new List(); + var hitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(); + // Use constant seed for reproducibility var random = new Random(0); - for (int i = 0; i < 500; i++) + for (int i = 0; i < hitEvents.Count; i++) { double angle = random.NextDouble() * 2 * Math.PI; double radius = random.NextDouble() * 0.5f * OsuHitObject.OBJECT_RADIUS; var position = new Vector2((float)(radius * Math.Cos(angle)), (float)(radius * Math.Sin(angle))); - hitEvents.Add(new HitEvent(0, HitResult.Perfect, new HitCircle(), new HitCircle(), position)); + hitEvents[i] = hitEvents[i].With(position); } return hitEvents; From 6e9785ec589fe7f586d213b4cb17242dbb6360eb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 01:06:26 +0900 Subject: [PATCH 02/18] Add full statistics score to `TestSceneResultsScreen` --- osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs | 5 ++++- osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs index c5b61c1a9001..4eba60de3c87 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs @@ -82,7 +82,10 @@ public void TestResultsWithoutPlayer() RelativeSizeAxes = Axes.Both }; - stack.Push(screen = createResultsScreen()); + var score = TestResources.CreateTestScoreInfo(); + score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents(); + + stack.Push(screen = createResultsScreen(score)); }); AddUntilStep("wait for loaded", () => screen.IsLoaded); AddAssert("retry overlay not present", () => screen.RetryOverlay == null); diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs index 69c9fcb637d5..e02782678fb3 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs @@ -33,7 +33,7 @@ public partial class TestSceneStatisticsPanel : OsuTestScene public void TestScoreWithPositionStatistics() { var score = TestResources.CreateTestScoreInfo(); - score.HitEvents = createPositionDistributedHitEvents(); + score.HitEvents = CreatePositionDistributedHitEvents(); loadPanel(score); } @@ -87,7 +87,7 @@ private void loadPanel(ScoreInfo score) => AddStep("load panel", () => }; }); - private static List createPositionDistributedHitEvents() + public static List CreatePositionDistributedHitEvents() { var hitEvents = TestSceneHitEventTimingDistributionGraph.CreateDistributedHitEvents(); From b43949300bdee77effee0e6c5bfb5dc8daf012c1 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Jun 2023 19:06:48 +0900 Subject: [PATCH 03/18] Show online stats on `TestSceneStatisticsPanel` Fix test regression --- osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs | 1 + osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs index 4eba60de3c87..937bbe14480f 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs @@ -83,6 +83,7 @@ public void TestResultsWithoutPlayer() }; var score = TestResources.CreateTestScoreInfo(); + score.OnlineID = 1234; score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents(); stack.Push(screen = createResultsScreen(score)); diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs index e02782678fb3..e0d743b04689 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs @@ -13,6 +13,7 @@ using osu.Game.Beatmaps; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Online.Solo; using osu.Game.Rulesets; using osu.Game.Rulesets.Difficulty; using osu.Game.Rulesets.Mods; @@ -23,6 +24,7 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Tests.Resources; +using osu.Game.Users; using osuTK; namespace osu.Game.Tests.Visual.Ranking @@ -33,6 +35,7 @@ public partial class TestSceneStatisticsPanel : OsuTestScene public void TestScoreWithPositionStatistics() { var score = TestResources.CreateTestScoreInfo(); + score.OnlineID = 1234; score.HitEvents = CreatePositionDistributedHitEvents(); loadPanel(score); @@ -79,11 +82,12 @@ public void TestNullScore() private void loadPanel(ScoreInfo score) => AddStep("load panel", () => { - Child = new StatisticsPanel + Child = new SoloStatisticsPanel(score) { RelativeSizeAxes = Axes.Both, State = { Value = Visibility.Visible }, - Score = { Value = score } + Score = { Value = score }, + StatisticsUpdate = { Value = new SoloStatisticsUpdate(score, new UserStatistics(), new UserStatistics()) } }; }); From 48670308a501205d518ba1cb086e64cc4e1dfcdb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 01:29:58 +0900 Subject: [PATCH 04/18] Add actual statistics changes to better visualise layout --- .../Ranking/TestSceneStatisticsPanel.cs | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs index e0d743b04689..93005271a93b 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneStatisticsPanel.cs @@ -87,7 +87,44 @@ private void loadPanel(ScoreInfo score) => AddStep("load panel", () => RelativeSizeAxes = Axes.Both, State = { Value = Visibility.Visible }, Score = { Value = score }, - StatisticsUpdate = { Value = new SoloStatisticsUpdate(score, new UserStatistics(), new UserStatistics()) } + StatisticsUpdate = + { + Value = new SoloStatisticsUpdate(score, new UserStatistics + { + Level = new UserStatistics.LevelInfo + { + Current = 5, + Progress = 20, + }, + GlobalRank = 38000, + CountryRank = 12006, + PP = 2134, + RankedScore = 21123849, + Accuracy = 0.985, + PlayCount = 13375, + PlayTime = 354490, + TotalScore = 128749597, + TotalHits = 0, + MaxCombo = 1233, + }, new UserStatistics + { + Level = new UserStatistics.LevelInfo + { + Current = 5, + Progress = 30, + }, + GlobalRank = 36000, + CountryRank = 12000, + PP = (decimal)2134.5, + RankedScore = 23897015, + Accuracy = 0.984, + PlayCount = 13376, + PlayTime = 35789, + TotalScore = 132218497, + TotalHits = 0, + MaxCombo = 1233, + }) + } }; }); From 8c4831e09f6c8acd1cd0919b2990dbcba0bfb45a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 01:24:09 +0900 Subject: [PATCH 05/18] Reorder tests for testability --- .../Visual/Ranking/TestSceneResultsScreen.cs | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs index 937bbe14480f..1c904a936f8e 100644 --- a/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs +++ b/osu.Game.Tests/Visual/Ranking/TestSceneResultsScreen.cs @@ -69,6 +69,30 @@ public void TestScaling() })); } + [TestCase(1, ScoreRank.X)] + [TestCase(0.9999, ScoreRank.S)] + [TestCase(0.975, ScoreRank.S)] + [TestCase(0.925, ScoreRank.A)] + [TestCase(0.85, ScoreRank.B)] + [TestCase(0.75, ScoreRank.C)] + [TestCase(0.5, ScoreRank.D)] + [TestCase(0.2, ScoreRank.D)] + public void TestResultsWithPlayer(double accuracy, ScoreRank rank) + { + TestResultsScreen screen = null; + + var score = TestResources.CreateTestScoreInfo(); + + score.OnlineID = 1234; + score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents(); + score.Accuracy = accuracy; + score.Rank = rank; + + loadResultsScreen(() => screen = createResultsScreen(score)); + AddUntilStep("wait for loaded", () => screen.IsLoaded); + AddAssert("retry overlay present", () => screen.RetryOverlay != null); + } + [Test] public void TestResultsWithoutPlayer() { @@ -83,8 +107,6 @@ public void TestResultsWithoutPlayer() }; var score = TestResources.CreateTestScoreInfo(); - score.OnlineID = 1234; - score.HitEvents = TestSceneStatisticsPanel.CreatePositionDistributedHitEvents(); stack.Push(screen = createResultsScreen(score)); }); @@ -92,28 +114,6 @@ public void TestResultsWithoutPlayer() AddAssert("retry overlay not present", () => screen.RetryOverlay == null); } - [TestCase(0.2, ScoreRank.D)] - [TestCase(0.5, ScoreRank.D)] - [TestCase(0.75, ScoreRank.C)] - [TestCase(0.85, ScoreRank.B)] - [TestCase(0.925, ScoreRank.A)] - [TestCase(0.975, ScoreRank.S)] - [TestCase(0.9999, ScoreRank.S)] - [TestCase(1, ScoreRank.X)] - public void TestResultsWithPlayer(double accuracy, ScoreRank rank) - { - TestResultsScreen screen = null; - - var score = TestResources.CreateTestScoreInfo(); - - score.Accuracy = accuracy; - score.Rank = rank; - - loadResultsScreen(() => screen = createResultsScreen(score)); - AddUntilStep("wait for loaded", () => screen.IsLoaded); - AddAssert("retry overlay present", () => screen.RetryOverlay != null); - } - [Test] public void TestResultsForUnranked() { @@ -332,13 +332,14 @@ public TestResultsContainer(IScreen screen) } } - private partial class TestResultsScreen : ResultsScreen + private partial class TestResultsScreen : SoloResultsScreen { public HotkeyRetryOverlay RetryOverlay; public TestResultsScreen(ScoreInfo score) : base(score, true) { + ShowUserStatistics = true; } protected override void LoadComplete() From 98bf15182efada7ceb1b9d9fa2b1ca9a6bef02f5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Jun 2023 18:17:57 +0900 Subject: [PATCH 06/18] Remove more `GridContainer` nonsense --- .../Ranking/Statistics/StatisticContainer.cs | 29 ++++++------------- .../Ranking/Statistics/StatisticsPanel.cs | 24 ++++----------- 2 files changed, 15 insertions(+), 38 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs b/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs index 9191ee6f520a..f3308e993174 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs @@ -26,31 +26,20 @@ public StatisticContainer(StatisticItem item) RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - InternalChild = new GridContainer + InternalChild = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Content = new[] + Children = new[] { - new[] + createHeader(item), + new Container { - createHeader(item) - }, - new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Margin = new MarginPadding { Top = 15 }, - Child = item.CreateContent() - } - }, - }, - RowDimensions = new[] - { - new Dimension(GridSizeMode.AutoSize), - new Dimension(GridSizeMode.AutoSize), + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Margin = new MarginPadding { Top = 15 }, + Child = item.CreateContent() + } } }; } diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs index 8b059efaf4a9..40d2d299026f 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs @@ -124,7 +124,7 @@ private void populateStatistics(ValueChangedEvent score) } else { - FillFlowContainer rows; + FillFlowContainer flow; container = new OsuScrollContainer(Direction.Vertical) { RelativeSizeAxes = Axes.Both, @@ -133,11 +133,12 @@ private void populateStatistics(ValueChangedEvent score) Alpha = 0, Children = new[] { - rows = new FillFlowContainer + flow = new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Spacing = new Vector2(30, 15) + Spacing = new Vector2(30, 15), + Direction = FillDirection.Full, } } }; @@ -146,35 +147,22 @@ private void populateStatistics(ValueChangedEvent score) foreach (var item in statisticItems) { - var columnContent = new List(); - if (!hitEventsAvailable && item.RequiresHitEvents) { anyRequiredHitEvents = true; continue; } - columnContent.Add(new StatisticContainer(item) + flow.Add(new StatisticContainer(item) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }); - - rows.Add(new GridContainer - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Content = new[] { columnContent.ToArray() }, - ColumnDimensions = new[] { new Dimension() }, - RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) } - }); } if (anyRequiredHitEvents) { - rows.Add(new FillFlowContainer + flow.Add(new FillFlowContainer { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, From 7637a9e60394c79d3e1f1155b896ef75f8793cd9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jul 2023 18:16:09 +0900 Subject: [PATCH 07/18] Adjust metrics of `OverallRanking` --- .../Ranking/Statistics/User/OverallRanking.cs | 2 +- .../Statistics/User/RankingChangeRow.cs | 25 +++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs b/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs index 447f206128e5..1d3902322380 100644 --- a/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs +++ b/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs @@ -39,7 +39,7 @@ private void load() RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, - Spacing = new Vector2(10), + Spacing = new Vector2(5), Children = new Drawable[] { new GlobalRankChangeRow { StatisticsUpdate = { BindTarget = StatisticsUpdate } }, diff --git a/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs b/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs index 5348b4a5226c..534e1e58cde9 100644 --- a/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs +++ b/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs @@ -6,6 +6,7 @@ using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; using osu.Game.Graphics; @@ -46,7 +47,7 @@ private void load() new OsuSpriteText { Text = Label, - Font = OsuFont.Default.With(size: 18) + Font = OsuFont.Default.With(size: 14) }, new FillFlowContainer { @@ -65,17 +66,31 @@ private void load() Spacing = new Vector2(5), Children = new Drawable[] { - changeIcon = new SpriteIcon + new Container { + Size = new Vector2(14), Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - Size = new Vector2(18) + Children = new Drawable[] + { + new Circle + { + RelativeSizeAxes = Axes.Both, + Colour = colours.Gray1 + }, + changeIcon = new SpriteIcon + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Size = new Vector2(10), + }, + } }, currentValueText = new OsuSpriteText { Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, - Font = OsuFont.Default.With(size: 18, weight: FontWeight.Bold) + Font = OsuFont.Default.With(size: 14, weight: FontWeight.Bold) }, } }, @@ -123,7 +138,7 @@ private void onStatisticsUpdate(ValueChangedEvent statist } else { - comparisonColour = colours.Orange1; + comparisonColour = colours.Gray4; icon = FontAwesome.Solid.Minus; } From f223fd7c3bf5bd19b36b8abe613e6fd549576412 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jul 2023 18:16:15 +0900 Subject: [PATCH 08/18] Adjust metrics of `PerformanceBreakdown` --- .../Ranking/Statistics/PerformanceBreakdownChart.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs b/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs index 10cb77fa9195..6979f0ad946d 100644 --- a/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs +++ b/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs @@ -97,7 +97,7 @@ private void load() { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 18), + Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Text = "Achieved PP", Colour = Color4Extensions.FromHex("#66FFCC") }, @@ -105,7 +105,7 @@ private void load() { Origin = Anchor.CentreRight, Anchor = Anchor.CentreRight, - Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 18), + Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 14), Colour = Color4Extensions.FromHex("#66FFCC") } }, @@ -115,7 +115,7 @@ private void load() { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 18), + Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Text = "Maximum", Colour = OsuColour.Gray(0.7f) }, @@ -123,7 +123,7 @@ private void load() { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 18), + Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Colour = OsuColour.Gray(0.7f) } } @@ -208,7 +208,7 @@ private Drawable[] createAttributeRow(PerformanceDisplayAttribute attribute, Per { Origin = Anchor.CentreLeft, Anchor = Anchor.CentreLeft, - Font = OsuFont.GetFont(weight: FontWeight.Regular), + Font = OsuFont.GetFont(weight: FontWeight.Regular, size: 14), Text = attribute.DisplayName, Colour = Colour4.White }, @@ -233,7 +233,7 @@ private Drawable[] createAttributeRow(PerformanceDisplayAttribute attribute, Per { Origin = Anchor.CentreRight, Anchor = Anchor.CentreRight, - Font = OsuFont.GetFont(weight: FontWeight.SemiBold), + Font = OsuFont.GetFont(weight: FontWeight.SemiBold, size: 14), Text = percentage.ToLocalisableString("0%"), Colour = Colour4.White } From 4f089eb5a5d7d471d2d218a68df32c996c58f45a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jul 2023 18:16:55 +0900 Subject: [PATCH 09/18] Adjust metrics of `AccuracyHeatmap` --- osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs b/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs index 5d2f6a14c7b5..6564a086fea3 100644 --- a/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs +++ b/osu.Game.Rulesets.Osu/Statistics/AccuracyHeatmap.cs @@ -11,6 +11,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Utils; using osu.Game.Beatmaps; +using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Scoring; @@ -120,18 +121,22 @@ private void load() new OsuSpriteText { Text = "Overshoot", + Font = OsuFont.GetFont(size: 12), Anchor = Anchor.Centre, - Origin = Anchor.BottomCentre, - Padding = new MarginPadding(3), + Origin = Anchor.BottomLeft, + Padding = new MarginPadding(2), + Rotation = -rotation, RelativePositionAxes = Axes.Both, Y = -(inner_portion + line_extension) / 2, }, new OsuSpriteText { Text = "Undershoot", + Font = OsuFont.GetFont(size: 12), Anchor = Anchor.Centre, - Origin = Anchor.TopCentre, - Padding = new MarginPadding(3), + Origin = Anchor.TopRight, + Rotation = -rotation, + Padding = new MarginPadding(2), RelativePositionAxes = Axes.Both, Y = (inner_portion + line_extension) / 2, }, From d54cf639839f847e60fcc56202f322d0f59d0ad6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 18:29:20 +0900 Subject: [PATCH 10/18] Centralise font size specification for statistic items (and reduce slightly) --- .../Statistics/HitEventTimingDistributionGraph.cs | 8 ++++---- .../Ranking/Statistics/PerformanceBreakdownChart.cs | 12 ++++++------ .../Ranking/Statistics/SimpleStatisticItem.cs | 4 ++-- .../Screens/Ranking/Statistics/StatisticContainer.cs | 2 +- osu.Game/Screens/Ranking/Statistics/StatisticItem.cs | 5 +++++ .../Ranking/Statistics/User/RankingChangeRow.cs | 4 ++-- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs b/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs index e8d2eefd81fd..fb9a78fb54d2 100644 --- a/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs +++ b/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs @@ -154,7 +154,7 @@ private void createBarDrawables() axisFlow = new Container { RelativeSizeAxes = Axes.X, - Height = axis_font_size, + Height = StatisticItem.FONT_SIZE, } }, }, @@ -174,7 +174,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++) @@ -191,7 +191,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 @@ -202,7 +202,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) }); } } diff --git a/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs b/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs index 6979f0ad946d..ee0ce6183d0d 100644 --- a/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs +++ b/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs @@ -97,7 +97,7 @@ 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") }, @@ -105,7 +105,7 @@ private void load() { 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 @@ 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) }, @@ -123,7 +123,7 @@ 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), Colour = OsuColour.Gray(0.7f) } } @@ -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 }, @@ -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 } diff --git a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs index 99f4e1e34224..23ccc3d0b7e3 100644 --- a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs +++ b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs @@ -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) } }); } diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs b/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs index f3308e993174..c3cc443adb2a 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs @@ -70,7 +70,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), } } }; diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticItem.cs b/osu.Game/Screens/Ranking/Statistics/StatisticItem.cs index fd7a0ddb4fff..cf95886905dd 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticItem.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticItem.cs @@ -12,6 +12,11 @@ namespace osu.Game.Screens.Ranking.Statistics /// public class StatisticItem { + /// + /// The recommended font size to use in statistic items to make sure they match others. + /// + public const float FONT_SIZE = 13; + /// /// The name of this item. /// diff --git a/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs b/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs index 534e1e58cde9..a58e028baace 100644 --- a/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs +++ b/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs @@ -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 { @@ -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) }, } }, From 947b40149f3e7581f15d40d6daeccf772bf8ac61 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 18:30:05 +0900 Subject: [PATCH 11/18] Adjust metrics of `SimpleStatisticTable` --- osu.Game.Rulesets.Mania/ManiaRuleset.cs | 2 +- osu.Game.Rulesets.Osu/OsuRuleset.cs | 2 +- osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Mania/ManiaRuleset.cs b/osu.Game.Rulesets.Mania/ManiaRuleset.cs index bd6ab4086b2d..620009e1821a 100644 --- a/osu.Game.Rulesets.Mania/ManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/ManiaRuleset.cs @@ -412,7 +412,7 @@ public override StatisticItem[] CreateStatisticsForScore(ScoreInfo score, IBeatm RelativeSizeAxes = Axes.X, Height = 250 }, true), - new StatisticItem(string.Empty, () => new SimpleStatisticTable(3, new SimpleStatisticItem[] + new StatisticItem(string.Empty, () => new SimpleStatisticTable(2, new SimpleStatisticItem[] { new AverageHitError(score.HitEvents), new UnstableRate(score.HitEvents) diff --git a/osu.Game.Rulesets.Osu/OsuRuleset.cs b/osu.Game.Rulesets.Osu/OsuRuleset.cs index 036d13c5aa8d..3b24cc5997e2 100644 --- a/osu.Game.Rulesets.Osu/OsuRuleset.cs +++ b/osu.Game.Rulesets.Osu/OsuRuleset.cs @@ -319,7 +319,7 @@ public override StatisticItem[] CreateStatisticsForScore(ScoreInfo score, IBeatm RelativeSizeAxes = Axes.X, Height = 250 }, true), - new StatisticItem(string.Empty, () => new SimpleStatisticTable(3, new SimpleStatisticItem[] + new StatisticItem(string.Empty, () => new SimpleStatisticTable(2, new SimpleStatisticItem[] { new AverageHitError(timedHitEvents), new UnstableRate(timedHitEvents) diff --git a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs index d68df4558a0d..4eb49797245b 100644 --- a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs +++ b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs @@ -103,7 +103,6 @@ private partial class Spacer : CompositeDrawable public Spacer() { RelativeSizeAxes = Axes.Both; - Padding = new MarginPadding { Vertical = 4 }; InternalChild = new CircularContainer { From 0881f4772cb730855cb8ebc5ec8c27327bd8dc60 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 18:31:45 +0900 Subject: [PATCH 12/18] Adjust metrics of `HitEventTimingDistributionGraph` --- .../Ranking/Statistics/HitEventTimingDistributionGraph.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs b/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs index fb9a78fb54d2..1260ec2339e0 100644 --- a/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs +++ b/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs @@ -131,14 +131,11 @@ private void createBarDrawables() Container axisFlow; - const float axis_font_size = 12; + Padding = new MarginPadding { Horizontal = 5 }; InternalChild = new GridContainer { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Width = 0.8f, Content = new[] { new Drawable[] From 1a7b00ec152c15f467b05e1995bbfd32c7267403 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Jun 2023 17:52:08 +0900 Subject: [PATCH 13/18] Ensure `PerformanceBreakdown` pieces cannot be null --- .../Rulesets/Difficulty/PerformanceBreakdown.cs | 13 +++++++++++-- .../Difficulty/PerformanceBreakdownCalculator.cs | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/osu.Game/Rulesets/Difficulty/PerformanceBreakdown.cs b/osu.Game/Rulesets/Difficulty/PerformanceBreakdown.cs index bd971db4767b..6e41855ca34b 100644 --- a/osu.Game/Rulesets/Difficulty/PerformanceBreakdown.cs +++ b/osu.Game/Rulesets/Difficulty/PerformanceBreakdown.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - namespace osu.Game.Rulesets.Difficulty { /// @@ -19,5 +17,16 @@ public class PerformanceBreakdown /// Performance of a perfect play for comparison. /// public PerformanceAttributes PerfectPerformance { get; set; } + + /// + /// Create a new performance breakdown. + /// + /// Actual gameplay performance. + /// Performance of a perfect play for comparison. + public PerformanceBreakdown(PerformanceAttributes performance, PerformanceAttributes perfectPerformance) + { + Performance = performance; + PerfectPerformance = perfectPerformance; + } } } diff --git a/osu.Game/Rulesets/Difficulty/PerformanceBreakdownCalculator.cs b/osu.Game/Rulesets/Difficulty/PerformanceBreakdownCalculator.cs index 8b59500f43d3..ad9257d4f342 100644 --- a/osu.Game/Rulesets/Difficulty/PerformanceBreakdownCalculator.cs +++ b/osu.Game/Rulesets/Difficulty/PerformanceBreakdownCalculator.cs @@ -40,7 +40,7 @@ public async Task CalculateAsync(ScoreInfo score, Cancella getPerfectPerformance(score, cancellationToken) ).ConfigureAwait(false); - return new PerformanceBreakdown { Performance = performanceArray[0], PerfectPerformance = performanceArray[1] }; + return new PerformanceBreakdown(performanceArray[0] ?? new PerformanceAttributes(), performanceArray[1] ?? new PerformanceAttributes()); } [ItemCanBeNull] From b333945cde705b12b8de3b32838cf532dc3a9a6a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 01:58:38 +0900 Subject: [PATCH 14/18] Change `OverallRanking` to use a two-column layout similar to statistics table --- .../Statistics/SimpleStatisticTable.cs | 2 +- .../Ranking/Statistics/User/OverallRanking.cs | 49 ++++++++++++++----- .../Statistics/User/RankingChangeRow.cs | 5 +- 3 files changed, 41 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs index 4eb49797245b..ed31bc8643e5 100644 --- a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs +++ b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs @@ -98,7 +98,7 @@ private IEnumerable createColumns() Direction = FillDirection.Vertical }; - private partial class Spacer : CompositeDrawable + public partial class Spacer : CompositeDrawable { public Spacer() { diff --git a/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs b/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs index 1d3902322380..d08a654e998a 100644 --- a/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs +++ b/osu.Game/Screens/Ranking/Statistics/User/OverallRanking.cs @@ -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 { @@ -18,7 +17,7 @@ public partial class OverallRanking : CompositeDrawable public Bindable StatisticsUpdate { get; } = new Bindable(); private LoadingLayer loadingLayer = null!; - private FillFlowContainer content = null!; + private GridContainer content = null!; [BackgroundDependencyLoader] private void load() @@ -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 } }, + } } } }; diff --git a/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs b/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs index a58e028baace..906bf8d5cafd 100644 --- a/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs +++ b/osu.Game/Screens/Ranking/Statistics/User/RankingChangeRow.cs @@ -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 @@ -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) } } } From e34839c8918ef5fbda6fe2b547c4963feceed223 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 18:55:54 +0900 Subject: [PATCH 15/18] Rename `StatisticContainer` to `StatisticItemContainer` and add a background --- ...Container.cs => StatisticItemContainer.cs} | 43 ++++++++++++++----- .../Ranking/Statistics/StatisticsPanel.cs | 2 +- 2 files changed, 34 insertions(+), 11 deletions(-) rename osu.Game/Screens/Ranking/Statistics/{StatisticContainer.cs => StatisticItemContainer.cs} (62%) diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs b/osu.Game/Screens/Ranking/Statistics/StatisticItemContainer.cs similarity index 62% rename from osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs rename to osu.Game/Screens/Ranking/Statistics/StatisticItemContainer.cs index c3cc443adb2a..6e18ae1fe422 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticContainer.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticItemContainer.cs @@ -3,6 +3,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; +using osu.Framework.Graphics.Colour; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Localisation; @@ -15,31 +16,53 @@ namespace osu.Game.Screens.Ranking.Statistics /// /// Wraps a to add a header and suitable layout for use in . /// - internal partial class StatisticContainer : CompositeDrawable + internal partial class StatisticItemContainer : CompositeDrawable { /// - /// Creates a new . + /// Creates a new . /// /// The to display. - public StatisticContainer(StatisticItem item) + public StatisticItemContainer(StatisticItem item) { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - InternalChild = new FillFlowContainer + Padding = new MarginPadding(5); + + InternalChild = new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Children = new[] + Masking = true, + CornerRadius = 6, + Children = new Drawable[] { - createHeader(item), + new Box + { + Colour = ColourInfo.GradientVertical( + OsuColour.Gray(0.25f), + OsuColour.Gray(0.18f) + ), + Alpha = 0.95f, + RelativeSizeAxes = Axes.Both, + }, new Container { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Margin = new MarginPadding { Top = 15 }, - Child = item.CreateContent() - } + Padding = new MarginPadding(5), + Children = new[] + { + createHeader(item), + new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Padding = new MarginPadding(10) { Top = 30 }, + Child = item.CreateContent() + } + } + }, } }; } @@ -52,7 +75,7 @@ private static Drawable createHeader(StatisticItem item) return new FillFlowContainer { RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, + Height = 20, Direction = FillDirection.Horizontal, Spacing = new Vector2(5, 0), Children = new Drawable[] diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs index 40d2d299026f..8ab774f76dbc 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs @@ -153,7 +153,7 @@ private void populateStatistics(ValueChangedEvent score) continue; } - flow.Add(new StatisticContainer(item) + flow.Add(new StatisticItemContainer(item) { Anchor = Anchor.Centre, Origin = Anchor.Centre, From 2c27b17c85a14a39bc4dbdc0e5297945d6e0e838 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2023 19:00:03 +0900 Subject: [PATCH 16/18] Disable masking on inner scroll container --- osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs index 8ab774f76dbc..9357d1f38531 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs @@ -130,6 +130,8 @@ private void populateStatistics(ValueChangedEvent score) RelativeSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, + Masking = false, + ScrollbarOverlapsContent = false, Alpha = 0, Children = new[] { From 20bde40ce21b41d5a19add9e5a28e472f1460919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 13 Jul 2023 20:00:25 +0200 Subject: [PATCH 17/18] Fix differing anchor specs on statistics panel flow items --- osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs index 9357d1f38531..19bd0c4393da 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs @@ -157,8 +157,8 @@ private void populateStatistics(ValueChangedEvent score) flow.Add(new StatisticItemContainer(item) { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, }); } From 632077319f3e4763a6654a137c5723f5daba84c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Thu, 13 Jul 2023 20:06:53 +0200 Subject: [PATCH 18/18] Fix taiko statistics table not using 2-column layout --- osu.Game.Rulesets.Taiko/TaikoRuleset.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs index feb8b0c2c26f..584a91bfdc76 100644 --- a/osu.Game.Rulesets.Taiko/TaikoRuleset.cs +++ b/osu.Game.Rulesets.Taiko/TaikoRuleset.cs @@ -256,7 +256,7 @@ public override StatisticItem[] CreateStatisticsForScore(ScoreInfo score, IBeatm RelativeSizeAxes = Axes.X, Height = 250 }, true), - new StatisticItem("Statistics", () => new SimpleStatisticTable(3, new SimpleStatisticItem[] + new StatisticItem("Statistics", () => new SimpleStatisticTable(2, new SimpleStatisticItem[] { new AverageHitError(timedHitEvents), new UnstableRate(timedHitEvents)