From b28a1d38a6b66f0c678bfb1150a29dcdf82a2cfe Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 17:09:18 +0100 Subject: [PATCH 01/40] Simplify GradientLine and fix colour changing --- .../UserInterface/GradientLineTabControl.cs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs b/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs index baca57ea895f..1d67c4e033c0 100644 --- a/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs +++ b/osu.Game/Graphics/UserInterface/GradientLineTabControl.cs @@ -49,14 +49,7 @@ private class GradientLine : GridContainer public GradientLine() { RelativeSizeAxes = Axes.X; - Size = new Vector2(0.8f, 1.5f); - - ColumnDimensions = new[] - { - new Dimension(), - new Dimension(mode: GridSizeMode.Relative, size: 0.4f), - new Dimension(), - }; + Size = new Vector2(0.8f, 1f); Content = new[] { @@ -65,16 +58,12 @@ public GradientLine() new Box { RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientHorizontal(Color4.Transparent, Color4.White) - }, - new Box - { - RelativeSizeAxes = Axes.Both, + Colour = ColourInfo.GradientHorizontal(Color4.Transparent, Colour) }, new Box { RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.Transparent) + Colour = ColourInfo.GradientHorizontal(Colour, Color4.Transparent) }, } }; From 9bc45d21f13e2a048d991e9144cf773e2592389b Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 17:11:28 +0100 Subject: [PATCH 02/40] Recolour LeaderboardScopeSelector --- osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs b/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs index e2a725ec4610..20a3b09db493 100644 --- a/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs +++ b/osu.Game/Overlays/BeatmapSet/LeaderboardScopeSelector.cs @@ -26,10 +26,10 @@ public LeaderboardScopeSelector() } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - AccentColour = colours.Blue; - LineColour = Color4.Gray; + AccentColour = colourProvider.Highlight1; + LineColour = colourProvider.Background1; } private class ScopeSelectorTabItem : PageTabItem From 5eb1619e24ca180b99de8b762a30b9986dc4da75 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 18:02:49 +0100 Subject: [PATCH 03/40] Adjust title / artist font weight --- osu.Game/Overlays/BeatmapSet/Header.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 7c5c5a9d55a9..b62a5d46f015 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System.Linq; @@ -134,7 +134,7 @@ public Header() { title = new OsuSpriteText { - Font = OsuFont.GetFont(size: 37, weight: FontWeight.Bold, italics: true) + Font = OsuFont.GetFont(size: 37, weight: FontWeight.SemiBold, italics: true) }, externalLink = new ExternalLinkButton { @@ -144,7 +144,7 @@ public Header() }, } }, - artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 25, weight: FontWeight.SemiBold, italics: true) }, + artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 25, weight: FontWeight.Medium, italics: true) }, new Container { RelativeSizeAxes = Axes.X, From 5b881568db688d501f8464963ac85d87b751981a Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 19:15:02 +0100 Subject: [PATCH 04/40] Adjust header gradient colours --- osu.Game/Overlays/BeatmapSet/Header.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index b62a5d46f015..5cfbd2ef8387 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -93,10 +93,9 @@ public Header() RelativeSizeAxes = Axes.Both, Masking = true, }, - new Box + coverGradient = new Box { - RelativeSizeAxes = Axes.Both, - Colour = ColourInfo.GradientVertical(Color4.Black.Opacity(0.3f), Color4.Black.Opacity(0.8f)), + RelativeSizeAxes = Axes.Both }, }, }, @@ -215,8 +214,10 @@ public Header() } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { + coverGradient.Colour = ColourInfo.GradientVertical(colourProvider.Background6.Opacity(0.3f), colourProvider.Background6.Opacity(0.8f)); + State.BindValueChanged(_ => updateDownloadButtons()); BeatmapSet.BindValueChanged(setInfo => From b6301f6537753fa7ad6597dbb8b7a2135cdb2e7a Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 19:52:32 +0100 Subject: [PATCH 05/40] Adjust PreviewButton alpha and animation --- osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs index 8c884e09508a..80b287f6c6a0 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs @@ -22,7 +22,7 @@ public class PreviewButton : OsuClickableContainer { private const float transition_duration = 500; - private readonly Box bg, progress; + private readonly Box background, progress; private readonly PlayButton playButton; private PreviewTrack preview => playButton.Preview; @@ -40,10 +40,11 @@ public PreviewButton() Children = new Drawable[] { - bg = new Box + background = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(0.25f), + Colour = Color4.Black, + Alpha = 0.5f }, new Container { @@ -91,13 +92,13 @@ protected override void Update() protected override bool OnHover(HoverEvent e) { - bg.FadeColour(Color4.Black.Opacity(0.5f), 100); + background.FadeTo(0.75f, 80); return base.OnHover(e); } protected override void OnHoverLost(HoverLostEvent e) { - bg.FadeColour(Color4.Black.Opacity(0.25f), 100); + background.FadeTo(0.5f, 80); base.OnHoverLost(e); } } From a366a92d4c93001a0af58566ff68448d20f88e96 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 19:54:51 +0100 Subject: [PATCH 06/40] Use alpha instead of colour opacity --- osu.Game/Overlays/BeatmapSet/Details.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs index d76f6a43db34..627f3d04c9df 100644 --- a/osu.Game/Overlays/BeatmapSet/Details.cs +++ b/osu.Game/Overlays/BeatmapSet/Details.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -119,7 +118,8 @@ public DetailBox() new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Black.Opacity(0.5f), + Colour = Color4.Black, + Alpha = 0.5f }, content = new Container { From 86283cc422654e7babbb54a67cab8f8ccc8dc151 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 19:55:19 +0100 Subject: [PATCH 07/40] Recolour SuccessRate background --- osu.Game/Overlays/BeatmapSet/SuccessRate.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index 1dcc847760e7..dac750dacff8 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -105,10 +105,10 @@ public SuccessRate() } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, OverlayColourProvider colourProvider) { successRate.AccentColour = colours.Green; - successRate.BackgroundColour = colours.GrayD; + successRate.BackgroundColour = colourProvider.Background6; updateDisplay(); } From d0eb4e44719b20621362dc721cedfc18f17ab051 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 20:08:54 +0100 Subject: [PATCH 08/40] Add necessary variable --- osu.Game/Overlays/BeatmapSet/Header.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 5cfbd2ef8387..f2d1077844f7 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -30,6 +30,7 @@ public class Header : BeatmapDownloadTrackingComposite private const float buttons_spacing = 5; private readonly UpdateableBeatmapSetCover cover; + private readonly Box coverGradient; private readonly OsuSpriteText title, artist; private readonly AuthorInfo author; private readonly FillFlowContainer downloadButtonsContainer; From 2cc1255035d5f84aad41dd5cc21a38db0a837229 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 20:09:52 +0100 Subject: [PATCH 09/40] Adjust online status pill font and padding --- osu.Game/Overlays/BeatmapSet/Header.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index f2d1077844f7..dccebe5badc0 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -196,8 +196,8 @@ public Header() { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - TextSize = 14, - TextPadding = new MarginPadding { Horizontal = 25, Vertical = 8 } + TextSize = 17, + TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 } }, Details = new Details(), }, From 268bb73ac668f927f936b5c72798fc6cdf5fc270 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 20:14:50 +0100 Subject: [PATCH 10/40] Adjust header padding --- osu.Game/Overlays/BeatmapSet/Header.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index dccebe5badc0..c620ae2bca0b 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -106,8 +106,7 @@ public Header() AutoSizeAxes = Axes.Y, Padding = new MarginPadding { - Top = 20, - Bottom = 30, + Vertical = BeatmapSetOverlay.Y_PADDING, Left = BeatmapSetOverlay.X_PADDING, Right = BeatmapSetOverlay.X_PADDING + BeatmapSetOverlay.RIGHT_WIDTH, }, @@ -187,7 +186,7 @@ public Header() Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, AutoSizeAxes = Axes.Both, - Margin = new MarginPadding { Top = BeatmapSetOverlay.TOP_PADDING, Right = BeatmapSetOverlay.X_PADDING }, + Margin = new MarginPadding { Top = BeatmapSetOverlay.Y_PADDING, Right = BeatmapSetOverlay.X_PADDING }, Direction = FillDirection.Vertical, Spacing = new Vector2(10), Children = new Drawable[] From cbfb90983bfe8b146bcf1df5883c6b7b06a109d6 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 20:17:27 +0100 Subject: [PATCH 11/40] Rename variable --- osu.Game/Overlays/BeatmapSetOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index f747cfff16b3..7624351e41d2 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -21,7 +21,7 @@ namespace osu.Game.Overlays public class BeatmapSetOverlay : FullscreenOverlay { public const float X_PADDING = 40; - public const float TOP_PADDING = 25; + public const float Y_PADDING = 25; public const float RIGHT_WIDTH = 275; protected readonly Header Header; From 85fb4b4a18eb79ccd7b65786a3f99f83b67838f7 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:00:00 +0100 Subject: [PATCH 12/40] Recolour DetailBox --- osu.Game/Overlays/BeatmapSet/Details.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs index 627f3d04c9df..d24ad58a74f1 100644 --- a/osu.Game/Overlays/BeatmapSet/Details.cs +++ b/osu.Game/Overlays/BeatmapSet/Details.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; @@ -106,6 +106,8 @@ private void load() private class DetailBox : Container { private readonly Container content; + private readonly Box background; + protected override Container Content => content; public DetailBox() @@ -115,10 +117,9 @@ public DetailBox() InternalChildren = new Drawable[] { - new Box + background = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, Alpha = 0.5f }, content = new Container @@ -129,6 +130,12 @@ public DetailBox() }, }; } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + background.Colour = colourProvider.Background6; + } } } } From 88e79dfa78031b474fdb1ba341a4c8acb9c4ae13 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:00:27 +0100 Subject: [PATCH 13/40] Hide ratings if beatmap has no leaderboard --- osu.Game/Overlays/BeatmapSet/Details.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs index d24ad58a74f1..85341e6f1c40 100644 --- a/osu.Game/Overlays/BeatmapSet/Details.cs +++ b/osu.Game/Overlays/BeatmapSet/Details.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Allocation; @@ -20,6 +20,7 @@ public class Details : FillFlowContainer private readonly PreviewButton preview; private readonly BasicStats basic; private readonly AdvancedStats advanced; + private readonly DetailBox ratingBox; private BeatmapSetInfo beatmapSet; @@ -53,6 +54,7 @@ public BeatmapInfo Beatmap private void updateDisplay() { Ratings.Metrics = BeatmapSet?.Metrics; + ratingBox.Alpha = (BeatmapSet?.OnlineInfo?.Status ?? 0) > 0 ? 1 : 0; } public Details() @@ -85,7 +87,7 @@ public Details() Margin = new MarginPadding { Vertical = 7.5f }, }, }, - new DetailBox + ratingBox = new DetailBox { Child = Ratings = new UserRatings { From 48beb9fd6d45688911e18f08f81137bde53b03ee Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:01:02 +0100 Subject: [PATCH 14/40] Recolour PreviewButton --- osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs index 80b287f6c6a0..5ce283d0d857 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs @@ -43,7 +43,6 @@ public PreviewButton() background = new Box { RelativeSizeAxes = Axes.Both, - Colour = Color4.Black, Alpha = 0.5f }, new Container @@ -72,9 +71,10 @@ public PreviewButton() } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OsuColour colours, OverlayColourProvider colourProvider) { progress.Colour = colours.Yellow; + background.Colour = colourProvider.Background6; } protected override void Update() From 3ef6027d5718a11bd2a4ef8154c949d2911452f5 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:02:02 +0100 Subject: [PATCH 15/40] Show placeholder instead of success rate when beatmap unranked --- osu.Game/Overlays/BeatmapSet/Info.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index d7392b31e16d..516eee43ce6d 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -26,6 +26,7 @@ public class Info : Container private readonly Box successRateBackground; private readonly Box background; private readonly SuccessRate successRate; + private readonly OsuSpriteText unrankedPlaceholder; public readonly Bindable BeatmapSet = new Bindable(); @@ -110,6 +111,14 @@ public Info() RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 20, Horizontal = 15 }, }, + unrankedPlaceholder = new OsuSpriteText + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Alpha = 0, + Text = "Unranked beatmap", + Font = OsuFont.GetFont(size: 13) + }, }, }, }, @@ -122,6 +131,9 @@ public Info() tags.Text = b.NewValue?.Metadata.Tags ?? string.Empty; genre.Text = b.NewValue?.OnlineInfo?.Genre?.Name ?? string.Empty; language.Text = b.NewValue?.OnlineInfo?.Language?.Name ?? string.Empty; + var setHasLeaderboard = (b.NewValue?.OnlineInfo?.Status ?? 0) > 0; + successRate.Alpha = setHasLeaderboard ? 1 : 0; + unrankedPlaceholder.Alpha = setHasLeaderboard ? 0 : 1; }; } From 54580858499cb36326ef0a8beade69f5c568702c Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:11:35 +0100 Subject: [PATCH 16/40] Adjust TopScoreUserSection font and spacing --- osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 72a7efd777ed..1923c5a48ff4 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -96,13 +96,14 @@ public TopScoreUserSection() { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold) + Font = OsuFont.GetFont(size: 10) }, flag = new UpdateableFlag { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(19, 13), + Margin = new MarginPadding { Top = 2 }, // makes spacing look more even ShowPlaceholderOnNull = false, }, } From d23e4a1fa1cc649a7242b356298c081474ccdc35 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:27:51 +0100 Subject: [PATCH 17/40] Change scoreboard text size --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 7a17412722e2..c124f7b262f9 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; @@ -23,7 +23,7 @@ public class ScoreTable : TableContainer { private const float horizontal_inset = 20; private const float row_height = 25; - private const int text_size = 12; + private const int text_size = 14; private readonly FillFlowContainer backgroundFlow; From 979589704534c0592bb249b9f42084aadb929e77 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:28:31 +0100 Subject: [PATCH 18/40] Enforce correct column order in ScoreTable --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index c124f7b262f9..78203231714b 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -1,4 +1,4 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Framework.Graphics; @@ -65,6 +65,10 @@ public IReadOnlyList Scores for (int i = 0; i < value.Count; i++) backgroundFlow.Add(new ScoreTableRowBackground(i, value[i])); + // Ensure correct column order + foreach (ScoreInfo score in value) + score.Statistics = score.Statistics.OrderByDescending(pair => pair.Key).ToDictionary(pair => pair.Key, pair => pair.Value); + Columns = createHeaders(value[0]); Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular(); } From 82914b5d6e6f852f9d21ab65277b3889f3d19468 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:41:33 +0100 Subject: [PATCH 19/40] Adjust ScoreTable spacing --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 78203231714b..f04477d91101 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -81,9 +81,9 @@ private TableColumn[] createHeaders(ScoreInfo score) new TableColumn("rank", Anchor.CentreRight, new Dimension(GridSizeMode.AutoSize)), new TableColumn("", Anchor.Centre, new Dimension(GridSizeMode.Absolute, 70)), // grade new TableColumn("score", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)), - new TableColumn("accuracy", Anchor.CentreLeft, new Dimension(GridSizeMode.AutoSize)), + new TableColumn("accuracy", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 60, maxSize: 70)), new TableColumn("player", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 150)), - new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 90)) + new TableColumn("max combo", Anchor.CentreLeft, new Dimension(GridSizeMode.Distributed, minSize: 70, maxSize: 110)) }; foreach (var statistic in score.Statistics) @@ -194,7 +194,7 @@ private class HeaderText : OsuSpriteText public HeaderText(string text) { Text = text.ToUpper(); - Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold); + Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold); } [BackgroundDependencyLoader] From d7af96a2e51817fbffa8d872d500f25081cc628b Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:42:01 +0100 Subject: [PATCH 20/40] Adjust corner radius --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs index 14ea3e6b382b..83271efe09dd 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs @@ -30,7 +30,7 @@ public ScoreTableRowBackground(int index, ScoreInfo score) RelativeSizeAxes = Axes.X; Height = 25; - CornerRadius = 3; + CornerRadius = 5; Masking = true; InternalChildren = new Drawable[] From 86c0b509835eae73a680c72f41bb6bc59124c9fd Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:45:45 +0100 Subject: [PATCH 21/40] Adjust font once again for readibility --- osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 1923c5a48ff4..9913493617c8 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -96,14 +96,14 @@ public TopScoreUserSection() { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Font = OsuFont.GetFont(size: 10) + Font = OsuFont.GetFont(size: 12) }, flag = new UpdateableFlag { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(19, 13), - Margin = new MarginPadding { Top = 2 }, // makes spacing look more even + Margin = new MarginPadding { Top = 3 }, // makes spacing look more even ShowPlaceholderOnNull = false, }, } From c1b8445b006fd22243a4235a7da14c458220b53f Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 21:53:23 +0100 Subject: [PATCH 22/40] Add spacing to match osu-web Note: due to osu-web using flex to even out the spacing and me not being able to implement the same behaviour here, I added a static margin to separate the title from the diffname above. This looks better than the previous state in most cases, the only scenario where this differs somehow visibly from web is on mapsets with large numbers of difficulties. --- osu.Game/Overlays/BeatmapSet/Header.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index c620ae2bca0b..9f79b92cb6fc 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -129,6 +129,7 @@ public Header() { Direction = FillDirection.Horizontal, AutoSizeAxes = Axes.Both, + Margin = new MarginPadding { Top = 15 }, Children = new Drawable[] { title = new OsuSpriteText From ae467538d3bf0ff1b3483ba201d8f19d7b7f46c9 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Tue, 4 Feb 2020 22:39:51 +0100 Subject: [PATCH 23/40] Fix tests --- .../Online/TestSceneBeatmapSetOverlayDetails.cs | 11 ++++++++++- .../Online/TestSceneBeatmapSetOverlaySuccessRate.cs | 5 +++++ .../Online/TestSceneLeaderboardScopeSelector.cs | 5 +++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs index 990e0a166b4f..dea1e710b54a 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlayDetails.cs @@ -5,9 +5,11 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Utils; using osu.Game.Beatmaps; +using osu.Game.Overlays; using osu.Game.Overlays.BeatmapSet; using osu.Game.Screens.Select.Details; @@ -22,6 +24,9 @@ public class TestSceneBeatmapSetOverlayDetails : OsuTestScene private RatingsExposingDetails details; + [Cached] + private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); + [SetUp] public void Setup() => Schedule(() => { @@ -55,8 +60,12 @@ public void TestMetrics() { Fails = Enumerable.Range(1, 100).Select(_ => RNG.Next(10)).ToArray(), Retries = Enumerable.Range(-2, 100).Select(_ => RNG.Next(10)).ToArray(), - } + }, } + }, + OnlineInfo = new BeatmapSetOnlineInfo + { + Status = BeatmapSetOnlineStatus.Ranked } }; } diff --git a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlaySuccessRate.cs b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlaySuccessRate.cs index 2b572c1f6ca8..03003daf81e1 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlaySuccessRate.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneBeatmapSetOverlaySuccessRate.cs @@ -5,11 +5,13 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; +using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Utils; using osu.Game.Beatmaps; +using osu.Game.Overlays; using osu.Game.Overlays.BeatmapSet; using osu.Game.Screens.Select.Details; using osuTK; @@ -26,6 +28,9 @@ public class TestSceneBeatmapSetOverlaySuccessRate : OsuTestScene private GraphExposingSuccessRate successRate; + [Cached] + private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); + [SetUp] public void Setup() => Schedule(() => { diff --git a/osu.Game.Tests/Visual/Online/TestSceneLeaderboardScopeSelector.cs b/osu.Game.Tests/Visual/Online/TestSceneLeaderboardScopeSelector.cs index cc3b2ac68bad..f9a7bc99c377 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneLeaderboardScopeSelector.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneLeaderboardScopeSelector.cs @@ -7,11 +7,16 @@ using osu.Framework.Graphics; using osu.Framework.Bindables; using osu.Game.Screens.Select.Leaderboards; +using osu.Framework.Allocation; +using osu.Game.Overlays; namespace osu.Game.Tests.Visual.Online { public class TestSceneLeaderboardScopeSelector : OsuTestScene { + [Cached] + private OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); + public override IReadOnlyList RequiredTypes => new[] { typeof(LeaderboardScopeSelector), From b606408667e842dd0326bf071fa551a2e1de7452 Mon Sep 17 00:00:00 2001 From: Tree Date: Tue, 4 Feb 2020 23:02:28 +0100 Subject: [PATCH 24/40] Remove space --- osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 9913493617c8..00171e1170ae 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -103,7 +103,7 @@ public TopScoreUserSection() Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, Size = new Vector2(19, 13), - Margin = new MarginPadding { Top = 3 }, // makes spacing look more even + Margin = new MarginPadding { Top = 3 }, // makes spacing look more even ShowPlaceholderOnNull = false, }, } From 23d1d3fdf11bb9cf23e416cd0478dd8ba8ab4644 Mon Sep 17 00:00:00 2001 From: Tree Date: Tue, 4 Feb 2020 23:09:10 +0100 Subject: [PATCH 25/40] Convert field to local variable --- osu.Game/Overlays/BeatmapSet/Info.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index 516eee43ce6d..a71409a05f27 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -26,7 +26,6 @@ public class Info : Container private readonly Box successRateBackground; private readonly Box background; private readonly SuccessRate successRate; - private readonly OsuSpriteText unrankedPlaceholder; public readonly Bindable BeatmapSet = new Bindable(); @@ -39,6 +38,8 @@ public BeatmapInfo Beatmap public Info() { MetadataSection source, tags, genre, language; + OsuSpriteText unrankedPlaceholder; + RelativeSizeAxes = Axes.X; Height = 220; Masking = true; From c2a80119ca4cf9c65755abecfc9000dd234cc446 Mon Sep 17 00:00:00 2001 From: Tree Date: Tue, 4 Feb 2020 23:23:57 +0100 Subject: [PATCH 26/40] Remove using directives --- osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs index 5ce283d0d857..7eae05e4a961 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/PreviewButton.cs @@ -3,7 +3,6 @@ using osu.Framework.Allocation; using osu.Framework.Bindables; -using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; @@ -14,7 +13,6 @@ using osu.Game.Graphics.Containers; using osu.Game.Overlays.Direct; using osuTK; -using osuTK.Graphics; namespace osu.Game.Overlays.BeatmapSet.Buttons { From 447f31ccfc21f96f3795c6e4f121e3a1f82aded0 Mon Sep 17 00:00:00 2001 From: Tree Date: Tue, 4 Feb 2020 23:25:21 +0100 Subject: [PATCH 27/40] Remove using directive --- osu.Game/Overlays/BeatmapSet/Details.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs index 85341e6f1c40..bd13b4371e34 100644 --- a/osu.Game/Overlays/BeatmapSet/Details.cs +++ b/osu.Game/Overlays/BeatmapSet/Details.cs @@ -9,7 +9,6 @@ using osu.Game.Overlays.BeatmapSet.Buttons; using osu.Game.Screens.Select.Details; using osuTK; -using osuTK.Graphics; namespace osu.Game.Overlays.BeatmapSet { From f4ee281dd6474552d935bda91234daf6c575d5ba Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 16:15:55 +0100 Subject: [PATCH 28/40] Add optional decimal place --- osu.Game/Overlays/BeatmapSet/SuccessRate.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index dac750dacff8..15216b6e6997 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -42,7 +42,7 @@ private void updateDisplay() int playCount = beatmap?.OnlineInfo?.PlayCount ?? 0; var rate = playCount != 0 ? (float)passCount / playCount : 0; - successPercent.Text = rate.ToString("0%"); + successPercent.Text = rate.ToString("0.#%"); successRate.Length = rate; percentContainer.ResizeWidthTo(successRate.Length, 250, Easing.InOutCubic); From 76037e4ffddab6a219219b8a909209dcb06a002f Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 16:31:14 +0100 Subject: [PATCH 29/40] Recolour ranked status pill --- .../Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs | 9 ++++++++- osu.Game/Overlays/BeatmapSet/Header.cs | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs index 351e5df17a6a..f6e03d40ff36 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetOnlineStatusPill.cs @@ -13,6 +13,7 @@ namespace osu.Game.Beatmaps.Drawables public class BeatmapSetOnlineStatusPill : CircularContainer { private readonly OsuSpriteText statusText; + private readonly Box background; private BeatmapSetOnlineStatus status; @@ -43,6 +44,12 @@ public MarginPadding TextPadding set => statusText.Padding = value; } + public Color4 BackgroundColour + { + get => background.Colour; + set => background.Colour = value; + } + public BeatmapSetOnlineStatusPill() { AutoSizeAxes = Axes.Both; @@ -50,7 +57,7 @@ public BeatmapSetOnlineStatusPill() Children = new Drawable[] { - new Box + background = new Box { RelativeSizeAxes = Axes.Both, Colour = Color4.Black, diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 9f79b92cb6fc..1b111ced1f8e 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -218,6 +218,7 @@ public Header() private void load(OverlayColourProvider colourProvider) { coverGradient.Colour = ColourInfo.GradientVertical(colourProvider.Background6.Opacity(0.3f), colourProvider.Background6.Opacity(0.8f)); + onlineStatusPill.BackgroundColour = colourProvider.Background6; State.BindValueChanged(_ => updateDownloadButtons()); From e1e1c1a11af6a8397b43d250d0fba0edcb0268b2 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 16:34:39 +0100 Subject: [PATCH 30/40] Match osu-web display accuracy Decided to change this only locally instead of modifying FormatAccuracy which would affect everywhere else in the game as well. --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index f04477d91101..9c71cabfa662 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -120,7 +120,7 @@ private Drawable[] createContent(int index, ScoreInfo score) new OsuSpriteText { Margin = new MarginPadding { Right = horizontal_inset }, - Text = score.DisplayAccuracy, + Text = $@"{score.Accuracy:0.00%}", Font = OsuFont.GetFont(size: text_size), Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White }, From fa3934ddb474b605b3147a364f43ce968984f7b5 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 17:16:20 +0100 Subject: [PATCH 31/40] Match osu-web button description --- osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs index e0360c63127f..5ed15cecd5b5 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs @@ -150,7 +150,7 @@ private void load(IAPIProvider api, BeatmapManager beatmaps) }, new OsuSpriteText { - Text = BeatmapSet.Value.OnlineInfo.HasVideo && noVideo ? "without Video" : string.Empty, + Text = BeatmapSet.Value.OnlineInfo.HasVideo ? (noVideo ? "without Video" : "with Video") : string.Empty, Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold) }, }; From e79ba9a1299fc54728d9762af30e5e38a02f0e4b Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 17:41:57 +0100 Subject: [PATCH 32/40] Add alwaysShowDecimals param to FormatAccuracy This allows us to specify whether we want it to show decimal places if accuracy is 100%. --- osu.Game/Utils/FormatUtils.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Utils/FormatUtils.cs b/osu.Game/Utils/FormatUtils.cs index b3758b3375ae..f0b8b470f12e 100644 --- a/osu.Game/Utils/FormatUtils.cs +++ b/osu.Game/Utils/FormatUtils.cs @@ -7,18 +7,18 @@ public static class FormatUtils { /// /// Turns the provided accuracy into a percentage with 2 decimal places. - /// Omits all decimal places when equals 1d. /// /// The accuracy to be formatted + /// Whether to show decimal places if equals 1d /// formatted accuracy in percentage - public static string FormatAccuracy(this double accuracy) => accuracy == 1 ? "100%" : $"{accuracy:0.00%}"; + public static string FormatAccuracy(this double accuracy, bool alwaysShowDecimals = false) => accuracy == 1 && !alwaysShowDecimals ? "100%" : $"{accuracy:0.00%}"; /// /// Turns the provided accuracy into a percentage with 2 decimal places. - /// Omits all decimal places when equals 100m. /// /// The accuracy to be formatted + /// Whether to show decimal places if equals 100m /// formatted accuracy in percentage - public static string FormatAccuracy(this decimal accuracy) => accuracy == 100 ? "100%" : $"{accuracy:0.00}%"; + public static string FormatAccuracy(this decimal accuracy, bool alwaysShowDecimals = false) => accuracy == 100 && !alwaysShowDecimals ? "100%" : $"{accuracy:0.00}%"; } } From 63df6b8da6255116b7c6fe25df8c5d09fe797cc3 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 17:42:14 +0100 Subject: [PATCH 33/40] Change accuracy formatting method --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 9c71cabfa662..4d5bd8409092 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -16,6 +16,7 @@ using osu.Game.Users.Drawables; using osuTK; using osuTK.Graphics; +using osu.Game.Utils; namespace osu.Game.Overlays.BeatmapSet.Scores { @@ -120,7 +121,7 @@ private Drawable[] createContent(int index, ScoreInfo score) new OsuSpriteText { Margin = new MarginPadding { Right = horizontal_inset }, - Text = $@"{score.Accuracy:0.00%}", + Text = score.Accuracy.FormatAccuracy(alwaysShowDecimals: true), Font = OsuFont.GetFont(size: text_size), Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White }, From c93d2c7f00240ec8126732e801c66389f041457b Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Wed, 5 Feb 2020 18:26:01 +0100 Subject: [PATCH 34/40] Adjust loading container corner radius --- osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 0a3b5d9457a2..8560232209a6 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -164,7 +164,7 @@ public ScoresContainer() { RelativeSizeAxes = Axes.Both, Masking = true, - CornerRadius = 10, + CornerRadius = 5, Child = loading = new DimmedLoadingLayer(iconScale: 0.8f) { Alpha = 0, From c09af0052bf3f2e1a2e4809b12aeeb166f0501af Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Thu, 6 Feb 2020 20:21:47 +0100 Subject: [PATCH 35/40] Revert accuracy display and column sorting changes --- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 7 +------ osu.Game/Utils/FormatUtils.cs | 8 ++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 4d5bd8409092..2310b2a0f53e 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -16,7 +16,6 @@ using osu.Game.Users.Drawables; using osuTK; using osuTK.Graphics; -using osu.Game.Utils; namespace osu.Game.Overlays.BeatmapSet.Scores { @@ -66,10 +65,6 @@ public IReadOnlyList Scores for (int i = 0; i < value.Count; i++) backgroundFlow.Add(new ScoreTableRowBackground(i, value[i])); - // Ensure correct column order - foreach (ScoreInfo score in value) - score.Statistics = score.Statistics.OrderByDescending(pair => pair.Key).ToDictionary(pair => pair.Key, pair => pair.Value); - Columns = createHeaders(value[0]); Content = value.Select((s, i) => createContent(i, s)).ToArray().ToRectangular(); } @@ -121,7 +116,7 @@ private Drawable[] createContent(int index, ScoreInfo score) new OsuSpriteText { Margin = new MarginPadding { Right = horizontal_inset }, - Text = score.Accuracy.FormatAccuracy(alwaysShowDecimals: true), + Text = score.DisplayAccuracy, Font = OsuFont.GetFont(size: text_size), Colour = score.Accuracy == 1 ? highAccuracyColour : Color4.White }, diff --git a/osu.Game/Utils/FormatUtils.cs b/osu.Game/Utils/FormatUtils.cs index f0b8b470f12e..b3758b3375ae 100644 --- a/osu.Game/Utils/FormatUtils.cs +++ b/osu.Game/Utils/FormatUtils.cs @@ -7,18 +7,18 @@ public static class FormatUtils { /// /// Turns the provided accuracy into a percentage with 2 decimal places. + /// Omits all decimal places when equals 1d. /// /// The accuracy to be formatted - /// Whether to show decimal places if equals 1d /// formatted accuracy in percentage - public static string FormatAccuracy(this double accuracy, bool alwaysShowDecimals = false) => accuracy == 1 && !alwaysShowDecimals ? "100%" : $"{accuracy:0.00%}"; + public static string FormatAccuracy(this double accuracy) => accuracy == 1 ? "100%" : $"{accuracy:0.00%}"; /// /// Turns the provided accuracy into a percentage with 2 decimal places. + /// Omits all decimal places when equals 100m. /// /// The accuracy to be formatted - /// Whether to show decimal places if equals 100m /// formatted accuracy in percentage - public static string FormatAccuracy(this decimal accuracy, bool alwaysShowDecimals = false) => accuracy == 100 && !alwaysShowDecimals ? "100%" : $"{accuracy:0.00}%"; + public static string FormatAccuracy(this decimal accuracy) => accuracy == 100 ? "100%" : $"{accuracy:0.00}%"; } } From 7395f01919a6710fda4127676b6482e06d882676 Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Fri, 7 Feb 2020 20:28:02 +0100 Subject: [PATCH 36/40] Use osu-web font sizes --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 +- osu.Game/Overlays/BeatmapSet/Info.cs | 2 +- osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs | 4 ++-- osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 1b111ced1f8e..ab7b2d82ed11 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -196,7 +196,7 @@ public Header() { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - TextSize = 17, + TextSize = 14, TextPadding = new MarginPadding { Horizontal = 35, Vertical = 10 } }, Details = new Details(), diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index a71409a05f27..0a5415124ed3 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -118,7 +118,7 @@ public Info() Origin = Anchor.Centre, Alpha = 0, Text = "Unranked beatmap", - Font = OsuFont.GetFont(size: 13) + Font = OsuFont.GetFont(size: 12) }, }, }, diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 2310b2a0f53e..7f55aecaf02e 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -23,7 +23,7 @@ public class ScoreTable : TableContainer { private const float horizontal_inset = 20; private const float row_height = 25; - private const int text_size = 14; + private const int text_size = 12; private readonly FillFlowContainer backgroundFlow; @@ -190,7 +190,7 @@ private class HeaderText : OsuSpriteText public HeaderText(string text) { Text = text.ToUpper(); - Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold); + Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold); } [BackgroundDependencyLoader] diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 00171e1170ae..8a368aa5359c 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -96,7 +96,7 @@ public TopScoreUserSection() { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Font = OsuFont.GetFont(size: 12) + Font = OsuFont.GetFont(size: 10) }, flag = new UpdateableFlag { From e2950d7027003db5f9f1327cefae551a9a745117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 10 Feb 2020 20:27:46 +0100 Subject: [PATCH 37/40] Extract method to avoid nested ternaries --- .../BeatmapSet/Buttons/HeaderDownloadButton.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs b/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs index 5ed15cecd5b5..53003b0488c3 100644 --- a/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs +++ b/osu.Game/Overlays/BeatmapSet/Buttons/HeaderDownloadButton.cs @@ -150,7 +150,7 @@ private void load(IAPIProvider api, BeatmapManager beatmaps) }, new OsuSpriteText { - Text = BeatmapSet.Value.OnlineInfo.HasVideo ? (noVideo ? "without Video" : "with Video") : string.Empty, + Text = getVideoSuffixText(), Font = OsuFont.GetFont(size: 11, weight: FontWeight.Bold) }, }; @@ -163,5 +163,13 @@ private void load(IAPIProvider api, BeatmapManager beatmaps) private void userChanged(ValueChangedEvent e) => button.Enabled.Value = !(e.NewValue is GuestUser); private void enabledChanged(ValueChangedEvent e) => this.FadeColour(e.NewValue ? Color4.White : Color4.Gray, 200, Easing.OutQuint); + + private string getVideoSuffixText() + { + if (!BeatmapSet.Value.OnlineInfo.HasVideo) + return string.Empty; + + return noVideo ? "without Video" : "with Video"; + } } } From 811553cd60e47cca3d86386dc9b9c5c561255e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 10 Feb 2020 20:37:34 +0100 Subject: [PATCH 38/40] Remove unnecessary coercions Comparisons to null of nullable numbers are always false. --- osu.Game/Overlays/BeatmapSet/Details.cs | 2 +- osu.Game/Overlays/BeatmapSet/Info.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Details.cs b/osu.Game/Overlays/BeatmapSet/Details.cs index bd13b4371e34..488e181fa2ee 100644 --- a/osu.Game/Overlays/BeatmapSet/Details.cs +++ b/osu.Game/Overlays/BeatmapSet/Details.cs @@ -53,7 +53,7 @@ public BeatmapInfo Beatmap private void updateDisplay() { Ratings.Metrics = BeatmapSet?.Metrics; - ratingBox.Alpha = (BeatmapSet?.OnlineInfo?.Status ?? 0) > 0 ? 1 : 0; + ratingBox.Alpha = BeatmapSet?.OnlineInfo?.Status > 0 ? 1 : 0; } public Details() diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index 0a5415124ed3..85e871baca77 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -132,7 +132,7 @@ public Info() tags.Text = b.NewValue?.Metadata.Tags ?? string.Empty; genre.Text = b.NewValue?.OnlineInfo?.Genre?.Name ?? string.Empty; language.Text = b.NewValue?.OnlineInfo?.Language?.Name ?? string.Empty; - var setHasLeaderboard = (b.NewValue?.OnlineInfo?.Status ?? 0) > 0; + var setHasLeaderboard = b.NewValue?.OnlineInfo?.Status > 0; successRate.Alpha = setHasLeaderboard ? 1 : 0; unrankedPlaceholder.Alpha = setHasLeaderboard ? 0 : 1; }; From 35d5237dddf677dee02c7d2fc622e1d78abcacc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 10 Feb 2020 20:40:39 +0100 Subject: [PATCH 39/40] Adjust font sizes --- osu.Game/Overlays/BeatmapSet/Header.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index ab7b2d82ed11..5f4782573d53 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -134,7 +134,7 @@ public Header() { title = new OsuSpriteText { - Font = OsuFont.GetFont(size: 37, weight: FontWeight.SemiBold, italics: true) + Font = OsuFont.GetFont(size: 37.5f, weight: FontWeight.SemiBold, italics: true) }, externalLink = new ExternalLinkButton { @@ -144,7 +144,7 @@ public Header() }, } }, - artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 25, weight: FontWeight.Medium, italics: true) }, + artist = new OsuSpriteText { Font = OsuFont.GetFont(size: 20, weight: FontWeight.Medium, italics: true) }, new Container { RelativeSizeAxes = Axes.X, From e072042d4ecfd8e81517b34a845ebff5114e582c Mon Sep 17 00:00:00 2001 From: TheWildTree Date: Mon, 10 Feb 2020 21:11:49 +0100 Subject: [PATCH 40/40] Match osu-web font size --- osu.Game/Overlays/BeatmapSet/Header.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/BeatmapSet/Header.cs b/osu.Game/Overlays/BeatmapSet/Header.cs index 5f4782573d53..29f09a1ad833 100644 --- a/osu.Game/Overlays/BeatmapSet/Header.cs +++ b/osu.Game/Overlays/BeatmapSet/Header.cs @@ -134,7 +134,7 @@ public Header() { title = new OsuSpriteText { - Font = OsuFont.GetFont(size: 37.5f, weight: FontWeight.SemiBold, italics: true) + Font = OsuFont.GetFont(size: 30, weight: FontWeight.SemiBold, italics: true) }, externalLink = new ExternalLinkButton {