mirror of
https://github.com/ppy/osu.git
synced 2025-01-09 03:42:55 +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]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours, OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
ProfileItemContainer container;
|
|
||||||
|
|
||||||
AddRangeInternal(new Drawable[]
|
AddRangeInternal(new Drawable[]
|
||||||
{
|
{
|
||||||
new UpdateableBeatmapSetCover
|
new UpdateableBeatmapSetCover
|
||||||
@ -63,7 +61,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
CornerRadius = corner_radius,
|
CornerRadius = corner_radius,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
container = new ProfileItemContainer
|
new MostPlayedBeatmapContainer
|
||||||
{
|
{
|
||||||
Child = new Container
|
Child = new Container
|
||||||
{
|
{
|
||||||
@ -108,9 +106,16 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
container.IdleColour = colourProvider.Background4;
|
private class MostPlayedBeatmapContainer : ProfileItemContainer
|
||||||
container.HoverColour = colourProvider.Background3;
|
{
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OverlayColourProvider colourProvider)
|
||||||
|
{
|
||||||
|
IdleColour = colourProvider.Background4;
|
||||||
|
HoverColour = colourProvider.Background3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class MostPlayedBeatmapMetadataContainer : BeatmapMetadataContainer
|
private class MostPlayedBeatmapMetadataContainer : BeatmapMetadataContainer
|
||||||
|
@ -21,13 +21,29 @@ namespace osu.Game.Overlays.Profile.Sections
|
|||||||
|
|
||||||
private Color4 idleColour;
|
private Color4 idleColour;
|
||||||
|
|
||||||
public Color4 IdleColour
|
protected Color4 IdleColour
|
||||||
{
|
{
|
||||||
get => 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()
|
public ProfileItemContainer()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user