mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:52:54 +08:00
Make overlay elements use OverlayColourProvider
This commit is contained in:
parent
db4cd51d02
commit
e03a085d70
@ -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<string> 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<string>
|
||||
|
@ -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 =>
|
||||
|
@ -23,7 +23,6 @@ namespace osu.Game.Overlays.News
|
||||
public Action ShowFrontPage;
|
||||
|
||||
public NewsHeader()
|
||||
: base(OverlayColourScheme.Purple)
|
||||
{
|
||||
BreadcrumbControl.AddItem(front_page_string);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -24,7 +24,6 @@ namespace osu.Game.Overlays.Profile
|
||||
private DetailHeaderContainer detailHeaderContainer;
|
||||
|
||||
public ProfileHeader()
|
||||
: base(OverlayColourScheme.Green)
|
||||
{
|
||||
BackgroundHeight = 150;
|
||||
|
||||
|
@ -16,15 +16,10 @@ namespace osu.Game.Overlays
|
||||
|
||||
protected override TabControl<string> 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<string>
|
||||
|
Loading…
Reference in New Issue
Block a user