From 588a77484b65e07d5a5a1cc225dca96771b62eb8 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Mon, 3 Feb 2020 20:32:20 +0300 Subject: [PATCH] Add ContryFilter to new header --- .../Online/TestSceneRankingsCountryFilter.cs | 5 +++++ .../Visual/Online/TestSceneRankingsHeader.cs | 1 + osu.Game/Overlays/Rankings/CountryFilter.cs | 4 ++-- osu.Game/Overlays/Rankings/CountryPill.cs | 8 ++++---- .../Overlays/Rankings/RankingsOverlayHeader.cs | 14 ++++++++++++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/osu.Game.Tests/Visual/Online/TestSceneRankingsCountryFilter.cs b/osu.Game.Tests/Visual/Online/TestSceneRankingsCountryFilter.cs index 7ac65181f9..79862deb16 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneRankingsCountryFilter.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneRankingsCountryFilter.cs @@ -11,6 +11,8 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; using osuTK.Graphics; using osu.Game.Graphics.Sprites; +using osu.Game.Overlays; +using osu.Framework.Allocation; namespace osu.Game.Tests.Visual.Online { @@ -22,6 +24,9 @@ namespace osu.Game.Tests.Visual.Online typeof(CountryPill) }; + [Cached] + private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Green); + public TestSceneRankingsCountryFilter() { var countryBindable = new Bindable(); diff --git a/osu.Game.Tests/Visual/Online/TestSceneRankingsHeader.cs b/osu.Game.Tests/Visual/Online/TestSceneRankingsHeader.cs index ff2da39629..9837ae251d 100644 --- a/osu.Game.Tests/Visual/Online/TestSceneRankingsHeader.cs +++ b/osu.Game.Tests/Visual/Online/TestSceneRankingsHeader.cs @@ -17,6 +17,7 @@ namespace osu.Game.Tests.Visual.Online public override IReadOnlyList RequiredTypes => new[] { typeof(RankingsOverlayHeader), + typeof(CountryFilter), }; [Cached] diff --git a/osu.Game/Overlays/Rankings/CountryFilter.cs b/osu.Game/Overlays/Rankings/CountryFilter.cs index 2b12457ccc..4bdefb06ef 100644 --- a/osu.Game/Overlays/Rankings/CountryFilter.cs +++ b/osu.Game/Overlays/Rankings/CountryFilter.cs @@ -76,9 +76,9 @@ namespace osu.Game.Overlays.Rankings } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - background.Colour = colours.GreySeafoam; + background.Colour = colourProvider.Dark3; } protected override void LoadComplete() diff --git a/osu.Game/Overlays/Rankings/CountryPill.cs b/osu.Game/Overlays/Rankings/CountryPill.cs index 410d316006..1b19bbd95e 100644 --- a/osu.Game/Overlays/Rankings/CountryPill.cs +++ b/osu.Game/Overlays/Rankings/CountryPill.cs @@ -100,9 +100,9 @@ namespace osu.Game.Overlays.Rankings } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - background.Colour = colours.GreySeafoamDarker; + background.Colour = colourProvider.Background5; } protected override void LoadComplete() @@ -154,9 +154,9 @@ namespace osu.Game.Overlays.Rankings } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - IdleColour = colours.GreySeafoamLighter; + IdleColour = colourProvider.Light2; HoverColour = Color4.White; } } diff --git a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs index e4199ba56d..b3f96604ea 100644 --- a/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs +++ b/osu.Game/Overlays/Rankings/RankingsOverlayHeader.cs @@ -7,6 +7,7 @@ using osu.Game.Graphics.UserInterface; using osu.Game.Rulesets; using osu.Game.Users; using System.Collections.Generic; +using osu.Framework.Graphics.Containers; namespace osu.Game.Overlays.Rankings { @@ -27,6 +28,19 @@ namespace osu.Game.Overlays.Rankings Current = Ruleset }; + protected override Drawable CreateContent() => new Container + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + new CountryFilter + { + Current = Country + } + } + }; + private class RankingsTitle : ScreenTitle { public readonly Bindable Scope = new Bindable();