mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
Improve colouring logic
This commit is contained in:
parent
5838af39c1
commit
997be65be2
@ -37,10 +37,8 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
ProfileItemContainer container;
|
||||
|
||||
AddRangeInternal(new Drawable[]
|
||||
{
|
||||
new UpdateableBeatmapSetCover
|
||||
@ -63,7 +61,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
CornerRadius = corner_radius,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
container = new ProfileItemContainer
|
||||
new MostPlayedBeatmapContainer
|
||||
{
|
||||
Child = new Container
|
||||
{
|
||||
@ -108,9 +106,16 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
container.IdleColour = colourProvider.Background4;
|
||||
container.HoverColour = colourProvider.Background3;
|
||||
private class MostPlayedBeatmapContainer : ProfileItemContainer
|
||||
{
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OverlayColourProvider colourProvider)
|
||||
{
|
||||
IdleColour = colourProvider.Background4;
|
||||
HoverColour = colourProvider.Background3;
|
||||
}
|
||||
}
|
||||
|
||||
private class MostPlayedBeatmapMetadataContainer : BeatmapMetadataContainer
|
||||
|
@ -21,13 +21,29 @@ namespace osu.Game.Overlays.Profile.Sections
|
||||
|
||||
private Color4 idleColour;
|
||||
|
||||
public Color4 IdleColour
|
||||
protected Color4 IdleColour
|
||||
{
|
||||
get => idleColour;
|
||||
set => idleColour = background.Colour = value;
|
||||
set
|
||||
{
|
||||
idleColour = value;
|
||||
if (!IsHovered)
|
||||
background.Colour = value;
|
||||
}
|
||||
}
|
||||
|
||||
public Color4 HoverColour { get; set; }
|
||||
private Color4 hoverColour;
|
||||
|
||||
protected Color4 HoverColour
|
||||
{
|
||||
get => hoverColour;
|
||||
set
|
||||
{
|
||||
hoverColour = value;
|
||||
if (IsHovered)
|
||||
background.Colour = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ProfileItemContainer()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user