mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 08:52:55 +08:00
Add color to star rating and star sprite icon
This commit is contained in:
parent
515534cb34
commit
1f2f26a503
@ -37,7 +37,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
|
|
||||||
public string TooltipText { get; set; }
|
public string TooltipText { get; set; }
|
||||||
|
|
||||||
public ITooltip GetCustomTooltip() => new DifficultyIconTooltip();
|
public ITooltip GetCustomTooltip() => new DifficultyIconTooltip(AccentColour);
|
||||||
|
|
||||||
public class DifficultyIconTooltip : VisibilityContainer, ITooltip
|
public class DifficultyIconTooltip : VisibilityContainer, ITooltip
|
||||||
{
|
{
|
||||||
@ -46,7 +46,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
|
|
||||||
public string TooltipText { get; set; }
|
public string TooltipText { get; set; }
|
||||||
|
|
||||||
public DifficultyIconTooltip()
|
public DifficultyIconTooltip(Color4 accentColour)
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
@ -84,6 +84,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
|
Font = OsuFont.GetFont(size: 16, weight: FontWeight.Regular),
|
||||||
|
Colour = accentColour
|
||||||
},
|
},
|
||||||
new SpriteIcon
|
new SpriteIcon
|
||||||
{
|
{
|
||||||
@ -92,7 +93,7 @@ namespace osu.Game.Beatmaps.Drawables
|
|||||||
Margin = new MarginPadding { Left = 4 },
|
Margin = new MarginPadding { Left = 4 },
|
||||||
Icon = FontAwesome.Solid.Star,
|
Icon = FontAwesome.Solid.Star,
|
||||||
Size = new Vector2(12),
|
Size = new Vector2(12),
|
||||||
Colour = Color4.White,
|
Colour = accentColour,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user