diff --git a/osu.Game.Tests/Visual/Online/TestSceneUserProfileScores.cs b/osu.Game.Tests/Visual/Online/TestSceneUserProfileScores.cs index a303d88037..19b72e7071 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneUserProfileScores.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneUserProfileScores.cs @@ -12,6 +12,8 @@ using osuTK; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Mods; +using osu.Game.Overlays; +using osu.Framework.Allocation; namespace osu.Game.Tests.Visual.Online { @@ -74,11 +76,26 @@ namespace osu.Game.Tests.Visual.Online Spacing = new Vector2(0, 10), Children = new[] { - new DrawableProfileScore(score), - new DrawableProfileScore(noPPScore), - new DrawableProfileWeightedScore(score, 0.85), + new ColourProvidedContainer(OverlayColourScheme.Green, new DrawableProfileScore(score)), + new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileScore(noPPScore)), + new ColourProvidedContainer(OverlayColourScheme.Pink, new DrawableProfileWeightedScore(score, 0.85)) } }); } + + private class ColourProvidedContainer : Container + { + [Cached] + private readonly OverlayColourProvider colourProvider; + + public ColourProvidedContainer(OverlayColourScheme colourScheme, DrawableProfileScore score) + { + colourProvider = new OverlayColourProvider(colourScheme); + + AutoSizeAxes = Axes.Y; + RelativeSizeAxes = Axes.X; + Add(score); + } + } } } diff --git a/osu.Game.Tests/Visual/Online/TestSceneUserRanks.cs b/osu.Game.Tests/Visual/Online/TestSceneUserRanks.cs index 5cbdfb561e..c8e94b2915 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneUserRanks.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneUserRanks.cs @@ -4,11 +4,13 @@ using System; using System.Collections.Generic; using NUnit.Framework; +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.Containers; +using osu.Game.Overlays; using osu.Game.Overlays.Profile.Sections; using osu.Game.Overlays.Profile.Sections.Ranks; using osu.Game.Users; @@ -27,6 +29,9 @@ namespace osu.Game.Tests.Visual.Online typeof(RanksSection) }; + [Cached] + private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green); + public TestSceneUserRanks() { RanksSection ranks; diff --git a/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs b/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs index 99cad26a64..717ec4fb1a 100644 --- a/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/ProfileItemContainer.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Shapes; using osu.Framework.Input.Events; -using osu.Game.Graphics; using osuTK.Graphics; namespace osu.Game.Overlays.Profile.Sections @@ -43,10 +42,10 @@ namespace osu.Game.Overlays.Profile.Sections } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - background.Colour = idleColour = colours.GreySeafoam; - hoverColour = colours.GreySeafoamLight; + background.Colour = idleColour = colourProvider.Background4; + hoverColour = colourProvider.Background3; } protected override bool OnHover(HoverEvent e) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs index 722b4d2dae..9145ce6894 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/DrawableProfileScore.cs @@ -30,6 +30,9 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks [Resolved] private OsuColour colours { get; set; } + [Resolved] + private OverlayColourProvider colourProvider { get; set; } + public DrawableProfileScore(ScoreInfo score) { Score = score; @@ -91,7 +94,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks }, new DrawableDate(Score.Date, 12) { - Colour = colours.GreySeafoamLighter + Colour = colourProvider.Foreground1 } } } @@ -192,7 +195,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = OsuFont.GetFont(weight: FontWeight.Bold), Text = $"{Score.PP:0}", - Colour = colours.GreenLight + Colour = colourProvider.Highlight1 }, new OsuSpriteText { @@ -200,7 +203,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks Origin = Anchor.BottomLeft, Font = OsuFont.GetFont(size: 12, weight: FontWeight.Bold), Text = "pp", - Colour = colours.Green + Colour = colourProvider.Light3 } } }; @@ -210,7 +213,7 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks { Font = OsuFont.GetFont(weight: FontWeight.Bold), Text = "-", - Colour = colours.GreenLight + Colour = colourProvider.Highlight1 }; }