From e03a085d7071228941d0f1f20fd90d57806fc32c Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Fri, 24 Jan 2020 12:33:34 +0300 Subject: [PATCH] Make overlay elements use OverlayColourProvider --- .../Overlays/BreadcrumbControlOverlayHeader.cs | 10 ++-------- osu.Game/Overlays/Changelog/ChangelogHeader.cs | 2 -- osu.Game/Overlays/News/NewsHeader.cs | 1 - osu.Game/Overlays/OverlayColourProvider.cs | 2 +- osu.Game/Overlays/OverlayHeader.cs | 14 +++++--------- osu.Game/Overlays/Profile/ProfileHeader.cs | 1 - osu.Game/Overlays/TabControlOverlayHeader.cs | 9 ++------- 7 files changed, 10 insertions(+), 29 deletions(-) diff --git a/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs b/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs index 2e50c19729..c3f35b4313 100644 --- a/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs +++ b/osu.Game/Overlays/BreadcrumbControlOverlayHeader.cs @@ -4,7 +4,6 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.UserInterface; -using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays @@ -15,15 +14,10 @@ namespace osu.Game.Overlays protected override TabControl CreateTabControl() => BreadcrumbControl = new OverlayHeaderBreadcrumbControl(); - protected BreadcrumbControlOverlayHeader(OverlayColourScheme colourScheme) - : base(colourScheme) - { - } - [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - BreadcrumbControl.AccentColour = colours.ForOverlayElement(ColourScheme, 1, 0.75f); + BreadcrumbControl.AccentColour = colourProvider.Highlight1; } public class OverlayHeaderBreadcrumbControl : BreadcrumbControl diff --git a/osu.Game/Overlays/Changelog/ChangelogHeader.cs b/osu.Game/Overlays/Changelog/ChangelogHeader.cs index d5e0890b4d..70a45f2667 100644 --- a/osu.Game/Overlays/Changelog/ChangelogHeader.cs +++ b/osu.Game/Overlays/Changelog/ChangelogHeader.cs @@ -9,7 +9,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; -using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using osu.Game.Online.API.Requests.Responses; @@ -26,7 +25,6 @@ namespace osu.Game.Overlays.Changelog private const string listing_string = "listing"; public ChangelogHeader() - : base(OverlayColourScheme.Purple) { BreadcrumbControl.AddItem(listing_string); BreadcrumbControl.Current.ValueChanged += e => diff --git a/osu.Game/Overlays/News/NewsHeader.cs b/osu.Game/Overlays/News/NewsHeader.cs index 03dc64b3bd..457c5a19ba 100644 --- a/osu.Game/Overlays/News/NewsHeader.cs +++ b/osu.Game/Overlays/News/NewsHeader.cs @@ -23,7 +23,6 @@ namespace osu.Game.Overlays.News public Action ShowFrontPage; public NewsHeader() - : base(OverlayColourScheme.Purple) { BreadcrumbControl.AddItem(front_page_string); diff --git a/osu.Game/Overlays/OverlayColourProvider.cs b/osu.Game/Overlays/OverlayColourProvider.cs index 1223b8d064..e92a231bc1 100644 --- a/osu.Game/Overlays/OverlayColourProvider.cs +++ b/osu.Game/Overlays/OverlayColourProvider.cs @@ -66,7 +66,7 @@ namespace osu.Game.Overlays public Color4 Dark1 => convert(0.2f, 0.35f); public Color4 Dark2 => convert(0.2f, 0.3f); public Color4 Dark3 => convert(0.2f, 0.25f); - public Color4 Dark4 => convert(0.2f, 0.20f); + public Color4 Dark4 => convert(0.2f, 0.2f); public Color4 Dark5 => convert(0.2f, 0.15f); public Color4 Dark6 => convert(0.2f, 0.1f); public Color4 Foreground1 => convert(0.1f, 0.6f); diff --git a/osu.Game/Overlays/OverlayHeader.cs b/osu.Game/Overlays/OverlayHeader.cs index c9547bb5b8..2578f6a3bd 100644 --- a/osu.Game/Overlays/OverlayHeader.cs +++ b/osu.Game/Overlays/OverlayHeader.cs @@ -25,12 +25,8 @@ namespace osu.Game.Overlays set => background.Height = value; } - protected OverlayColourScheme ColourScheme { get; } - - protected OverlayHeader(OverlayColourScheme colourScheme) + protected OverlayHeader() { - ColourScheme = colourScheme; - RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -89,11 +85,11 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - titleBackground.Colour = colours.ForOverlayElement(ColourScheme, 0.2f, 0.15f); - title.AccentColour = colours.ForOverlayElement(ColourScheme, 1, 0.7f); - controlBackground.Colour = colours.ForOverlayElement(ColourScheme, 0.2f, 0.2f); + titleBackground.Colour = colourProvider.Dark5; + title.AccentColour = colourProvider.Highlight1; + controlBackground.Colour = colourProvider.Dark4; } protected abstract Drawable CreateBackground(); diff --git a/osu.Game/Overlays/Profile/ProfileHeader.cs b/osu.Game/Overlays/Profile/ProfileHeader.cs index b550d7d823..f8eb03770a 100644 --- a/osu.Game/Overlays/Profile/ProfileHeader.cs +++ b/osu.Game/Overlays/Profile/ProfileHeader.cs @@ -24,7 +24,6 @@ namespace osu.Game.Overlays.Profile private DetailHeaderContainer detailHeaderContainer; public ProfileHeader() - : base(OverlayColourScheme.Green) { BackgroundHeight = 150; diff --git a/osu.Game/Overlays/TabControlOverlayHeader.cs b/osu.Game/Overlays/TabControlOverlayHeader.cs index 8f3aa896ee..0c55b8383b 100644 --- a/osu.Game/Overlays/TabControlOverlayHeader.cs +++ b/osu.Game/Overlays/TabControlOverlayHeader.cs @@ -16,15 +16,10 @@ namespace osu.Game.Overlays protected override TabControl CreateTabControl() => TabControl = new OverlayHeaderTabControl(); - protected TabControlOverlayHeader(OverlayColourScheme colourScheme) - : base(colourScheme) - { - } - [BackgroundDependencyLoader] - private void load(OsuColour colours) + private void load(OverlayColourProvider colourProvider) { - TabControl.AccentColour = colours.ForOverlayElement(ColourScheme, 1, 0.75f); + TabControl.AccentColour = colourProvider.Highlight1; } public class OverlayHeaderTabControl : OverlayTabControl