diff --git a/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs b/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs index 1b136d9e41..3c959e05c1 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneScoresContainer.cs @@ -3,11 +3,13 @@ using System; using System.Collections.Generic; +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.Online.API.Requests.Responses; +using osu.Game.Overlays; using osu.Game.Overlays.BeatmapSet.Scores; using osu.Game.Rulesets.Osu.Mods; using osu.Game.Scoring; @@ -27,6 +29,9 @@ namespace osu.Game.Tests.Visual.Online typeof(ScoreTableRowBackground), }; + [Cached] + private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue); + public TestSceneScoresContainer() { TestScoresContainer scoresContainer; diff --git a/osu.Game/Overlays/BeatmapSet/Info.cs b/osu.Game/Overlays/BeatmapSet/Info.cs index 16d6236051..d7392b31e1 100644 --- a/osu.Game/Overlays/BeatmapSet/Info.cs +++ b/osu.Game/Overlays/BeatmapSet/Info.cs @@ -24,6 +24,7 @@ namespace osu.Game.Overlays.BeatmapSet private const float spacing = 20; private readonly Box successRateBackground; + private readonly Box background; private readonly SuccessRate successRate; public readonly Bindable BeatmapSet = new Bindable(); @@ -50,10 +51,9 @@ namespace osu.Game.Overlays.BeatmapSet Children = new Drawable[] { - new Box + background = new Box { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White, + RelativeSizeAxes = Axes.Both }, new Container { @@ -126,14 +126,14 @@ namespace osu.Game.Overlays.BeatmapSet } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - successRateBackground.Colour = colours.GrayE; + successRateBackground.Colour = colourProvider.Background4; + background.Colour = colourProvider.Background5; } private class MetadataSection : FillFlowContainer { - private readonly OsuSpriteText header; private readonly TextFlowContainer textFlow; public string Text @@ -148,7 +148,7 @@ namespace osu.Game.Overlays.BeatmapSet this.FadeIn(transition_duration); textFlow.Clear(); - textFlow.AddText(value, s => s.Font = s.Font.With(size: 14)); + textFlow.AddText(value, s => s.Font = s.Font.With(size: 12)); } } @@ -160,11 +160,10 @@ namespace osu.Game.Overlays.BeatmapSet InternalChildren = new Drawable[] { - header = new OsuSpriteText + new OsuSpriteText { Text = title, - Font = OsuFont.GetFont(size: 14, weight: FontWeight.Bold), - Shadow = false, + Font = OsuFont.GetFont(size: 14, weight: FontWeight.Black), Margin = new MarginPadding { Top = 20 }, }, textFlow = new OsuTextFlowContainer @@ -174,12 +173,6 @@ namespace osu.Game.Overlays.BeatmapSet }, }; } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - header.Colour = textFlow.Colour = colours.Gray5; - } } } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs index d263483046..e12c977430 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/DrawableTopScore.cs @@ -7,8 +7,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Shapes; -using osu.Framework.Input.Events; -using osu.Game.Graphics; using osu.Game.Scoring; using osuTK; using osuTK.Graphics; @@ -17,11 +15,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { public class DrawableTopScore : CompositeDrawable { - private const float fade_duration = 100; - - private Color4 backgroundIdleColour; - private Color4 backgroundHoveredColour; - private readonly Box background; public DrawableTopScore(ScoreInfo score, int position = 1) @@ -30,7 +23,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores AutoSizeAxes = Axes.Y; Masking = true; - CornerRadius = 10; + CornerRadius = 5; EdgeEffect = new EdgeEffectParameters { Type = EdgeEffectType.Shadow, @@ -84,24 +77,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - backgroundIdleColour = colours.Gray3; - backgroundHoveredColour = colours.Gray4; - - background.Colour = backgroundIdleColour; - } - - protected override bool OnHover(HoverEvent e) - { - background.FadeColour(backgroundHoveredColour, fade_duration, Easing.OutQuint); - return base.OnHover(e); - } - - protected override void OnHoverLost(HoverLostEvent e) - { - background.FadeColour(backgroundIdleColour, fade_duration, Easing.OutQuint); - base.OnHoverLost(e); + background.Colour = colourProvider.Background4; } private class AutoSizingGrid : GridContainer diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs index 3a944882ab..7a17412722 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTable.cs @@ -23,7 +23,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { 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,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores public HeaderText(string text) { Text = text.ToUpper(); - Font = OsuFont.GetFont(size: 12, weight: FontWeight.Black); + Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold); + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + Colour = colourProvider.Foreground1; } } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs index 724a7f8b55..14ea3e6b38 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoreTableRowBackground.cs @@ -48,18 +48,18 @@ namespace osu.Game.Overlays.BeatmapSet.Scores } [BackgroundDependencyLoader] - private void load(OsuColour colours, IAPIProvider api) + private void load(OsuColour colours, OverlayColourProvider colourProvider, IAPIProvider api) { var isOwnScore = api.LocalUser.Value.Id == score.UserID; if (isOwnScore) background.Colour = colours.GreenDarker; else if (index % 2 == 0) - background.Colour = colours.Gray3; + background.Colour = colourProvider.Background4; else background.Alpha = 0; - hoveredBackground.Colour = isOwnScore ? colours.GreenDark : colours.Gray4; + hoveredBackground.Colour = isOwnScore ? colours.GreenDark : colourProvider.Background3; } protected override bool OnHover(HoverEvent e) diff --git a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs index 0378d364b8..0a3b5d9457 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/ScoresContainer.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; -using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osuTK; using System.Linq; @@ -179,9 +178,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - background.Colour = colours.Gray2; + background.Colour = colourProvider.Background5; user.BindTo(api.LocalUser); } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs index 4f26e43fb2..7d410d0d34 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreStatisticsSection.cs @@ -24,8 +24,8 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { private const float margin = 10; - private readonly FontUsage smallFont = OsuFont.GetFont(size: 20); - private readonly FontUsage largeFont = OsuFont.GetFont(size: 25); + private readonly FontUsage smallFont = OsuFont.GetFont(size: 16); + private readonly FontUsage largeFont = OsuFont.GetFont(size: 22); private readonly TextColumn totalScoreColumn; private readonly TextColumn accuracyColumn; @@ -109,6 +109,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores private class InfoColumn : CompositeDrawable { private readonly Box separator; + private readonly OsuSpriteText text; public InfoColumn(string title, Drawable content) { @@ -121,15 +122,15 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Spacing = new Vector2(0, 2), Children = new[] { - new OsuSpriteText + text = new OsuSpriteText { - Font = OsuFont.GetFont(size: 12, weight: FontWeight.Black), + Font = OsuFont.GetFont(size: 10, weight: FontWeight.Black), Text = title.ToUpper() }, separator = new Box { RelativeSizeAxes = Axes.X, - Height = 2 + Height = 1 }, content } @@ -137,9 +138,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - separator.Colour = colours.Gray5; + separator.Colour = text.Colour = colourProvider.Foreground1; } } @@ -189,15 +190,11 @@ namespace osu.Game.Overlays.BeatmapSet.Scores set { modsContainer.Clear(); - - foreach (Mod mod in value) + modsContainer.Children = value.Select(mod => new ModIcon(mod) { - modsContainer.Add(new ModIcon(mod) - { - AutoSizeAxes = Axes.Both, - Scale = new Vector2(0.3f), - }); - } + AutoSizeAxes = Axes.Both, + Scale = new Vector2(0.25f), + }).ToList(); } } } diff --git a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs index 38a909411a..72a7efd777 100644 --- a/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs +++ b/osu.Game/Overlays/BeatmapSet/Scores/TopScoreUserSection.cs @@ -1,7 +1,6 @@ // 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; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -51,13 +50,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Font = OsuFont.GetFont(size: 24, weight: FontWeight.Bold, italics: true) + Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold) }, rank = new UpdateableRank(ScoreRank.D) { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(40), + Size = new Vector2(28), FillMode = FillMode.Fit, }, } @@ -66,7 +65,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.Centre, Origin = Anchor.Centre, - Size = new Vector2(80), + Size = new Vector2(70), Masking = true, CornerRadius = 5, EdgeEffect = new EdgeEffectParameters @@ -87,7 +86,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores Spacing = new Vector2(0, 3), Children = new Drawable[] { - usernameText = new LinkFlowContainer(s => s.Font = OsuFont.GetFont(size: 20, weight: FontWeight.Bold, italics: true)) + usernameText = new LinkFlowContainer(s => s.Font = OsuFont.GetFont(size: 18, weight: FontWeight.Bold, italics: true)) { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -97,13 +96,13 @@ namespace osu.Game.Overlays.BeatmapSet.Scores { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Font = OsuFont.GetFont(size: 15, weight: FontWeight.Bold) + Font = OsuFont.GetFont(size: 10, weight: FontWeight.Bold) }, flag = new UpdateableFlag { Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, - Size = new Vector2(20, 13), + Size = new Vector2(19, 13), ShowPlaceholderOnNull = false, }, } @@ -112,12 +111,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores }; } - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - rankText.Colour = colours.Yellow; - } - public int ScorePosition { set => rankText.Text = $"#{value}"; diff --git a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs index cd81013c30..1dcc847760 100644 --- a/osu.Game/Overlays/BeatmapSet/SuccessRate.cs +++ b/osu.Game/Overlays/BeatmapSet/SuccessRate.cs @@ -17,7 +17,7 @@ namespace osu.Game.Overlays.BeatmapSet protected readonly FailRetryGraph Graph; private readonly FillFlowContainer header; - private readonly OsuSpriteText successRateLabel, successPercent, graphLabel; + private readonly OsuSpriteText successPercent; private readonly Bar successRate; private readonly Container percentContainer; @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.BeatmapSet Direction = FillDirection.Vertical, Children = new Drawable[] { - successRateLabel = new OsuSpriteText + new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, @@ -85,7 +85,7 @@ namespace osu.Game.Overlays.BeatmapSet Font = OsuFont.GetFont(size: 13), }, }, - graphLabel = new OsuSpriteText + new OsuSpriteText { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, @@ -107,7 +107,6 @@ namespace osu.Game.Overlays.BeatmapSet [BackgroundDependencyLoader] private void load(OsuColour colours) { - successRateLabel.Colour = successPercent.Colour = graphLabel.Colour = colours.Gray5; successRate.AccentColour = colours.Green; successRate.BackgroundColour = colours.GrayD; diff --git a/osu.Game/Overlays/BeatmapSetOverlay.cs b/osu.Game/Overlays/BeatmapSetOverlay.cs index e4e928df18..f747cfff16 100644 --- a/osu.Game/Overlays/BeatmapSetOverlay.cs +++ b/osu.Game/Overlays/BeatmapSetOverlay.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; using osu.Game.Beatmaps; -using osu.Game.Graphics; using osu.Game.Graphics.Containers; using osu.Game.Online.API.Requests; using osu.Game.Overlays.BeatmapSet; @@ -33,6 +32,8 @@ namespace osu.Game.Overlays // receive input outside our bounds so we can trigger a close event on ourselves. public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + private readonly Box background; + public BeatmapSetOverlay() : base(OverlayColourScheme.Blue) { @@ -41,10 +42,9 @@ namespace osu.Game.Overlays Children = new Drawable[] { - new Box + background = new Box { - RelativeSizeAxes = Axes.Both, - Colour = OsuColour.Gray(0.2f) + RelativeSizeAxes = Axes.Both }, scroll = new OsuScrollContainer { @@ -55,10 +55,20 @@ namespace osu.Game.Overlays RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Direction = FillDirection.Vertical, + Spacing = new Vector2(0, 20), Children = new Drawable[] { - Header = new Header(), - info = new Info(), + new ReverseChildIDFillFlowContainer + { + AutoSizeAxes = Axes.Y, + RelativeSizeAxes = Axes.X, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + Header = new Header(), + info = new Info() + } + }, new ScoresContainer { Beatmap = { BindTarget = Header.Picker.Beatmap } @@ -83,6 +93,8 @@ namespace osu.Game.Overlays private void load(RulesetStore rulesets) { this.rulesets = rulesets; + + background.Colour = ColourProvider.Background6; } protected override void PopOutComplete()