mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Merge branch 'refactor-difficulty-colours' into difficulty-icon-tooltip
This commit is contained in:
@ -19,16 +19,18 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
public class DifficultyIcon : DifficultyColouredContainer, IHasCustomTooltip
|
||||
public class DifficultyIcon : Container, IHasCustomTooltip
|
||||
{
|
||||
private readonly BeatmapInfo beatmap;
|
||||
private readonly RulesetInfo ruleset;
|
||||
|
||||
public DifficultyIcon(BeatmapInfo beatmap, RulesetInfo ruleset = null, bool shouldShowTooltip = true)
|
||||
: base(beatmap)
|
||||
{
|
||||
if (beatmap == null)
|
||||
throw new ArgumentNullException(nameof(beatmap));
|
||||
|
||||
this.beatmap = beatmap;
|
||||
|
||||
this.ruleset = ruleset ?? beatmap.Ruleset;
|
||||
TooltipText = shouldShowTooltip ? $"{beatmap.Version}${beatmap.StarDifficulty:0.##}" : String.Empty;
|
||||
|
||||
@ -40,7 +42,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
public ITooltip GetCustomTooltip() => new DifficultyIconTooltip(AccentColour);
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -60,7 +62,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
Child = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = AccentColour,
|
||||
Colour = colours.ForDifficultyRating(beatmap.DifficultyRating),
|
||||
},
|
||||
},
|
||||
new ConstrainedIconContainer
|
||||
|
Reference in New Issue
Block a user