mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 15:33:21 +08:00
Use star difficulty colour spectrum game-wide
This commit is contained in:
parent
6fd97d67eb
commit
9a5e052dc0
@ -106,7 +106,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
Child = background = new Box
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = colours.ForDifficultyRating(beatmap.DifficultyRating) // Default value that will be re-populated once difficulty calculation completes
|
||||
Colour = colours.ForStarDifficulty(beatmap.StarDifficulty) // Default value that will be re-populated once difficulty calculation completes
|
||||
},
|
||||
},
|
||||
new ConstrainedIconContainer
|
||||
@ -124,7 +124,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
else
|
||||
difficultyBindable.Value = new StarDifficulty(beatmap.StarDifficulty, 0);
|
||||
|
||||
difficultyBindable.BindValueChanged(difficulty => background.Colour = colours.ForDifficultyRating(difficulty.NewValue.DifficultyRating));
|
||||
difficultyBindable.BindValueChanged(difficulty => background.Colour = colours.ForStarDifficulty(difficulty.NewValue.Stars));
|
||||
}
|
||||
|
||||
public ITooltip GetCustomTooltip() => new DifficultyIconTooltip();
|
||||
@ -271,7 +271,7 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
starDifficulty.BindValueChanged(difficulty =>
|
||||
{
|
||||
starRating.Text = $"{difficulty.NewValue.Stars:0.##}";
|
||||
difficultyFlow.Colour = colours.ForDifficultyRating(difficulty.NewValue.DifficultyRating, true);
|
||||
difficultyFlow.Colour = colours.ForStarDifficulty(difficulty.NewValue.Stars);
|
||||
}, true);
|
||||
|
||||
return true;
|
||||
|
@ -18,31 +18,6 @@ namespace osu.Game.Graphics
|
||||
public static Color4 Gray(byte amt) => new Color4(amt, amt, amt, 255);
|
||||
|
||||
public Color4 ForDifficultyRating(DifficultyRating difficulty, bool useLighterColour = false)
|
||||
{
|
||||
switch (difficulty)
|
||||
{
|
||||
case DifficultyRating.Easy:
|
||||
return Green;
|
||||
|
||||
default:
|
||||
case DifficultyRating.Normal:
|
||||
return Blue;
|
||||
|
||||
case DifficultyRating.Hard:
|
||||
return Yellow;
|
||||
|
||||
case DifficultyRating.Insane:
|
||||
return Pink;
|
||||
|
||||
case DifficultyRating.Expert:
|
||||
return PurpleLight;
|
||||
|
||||
case DifficultyRating.ExpertPlus:
|
||||
return useLighterColour ? Gray9 : Color4Extensions.FromHex("#121415");
|
||||
}
|
||||
}
|
||||
|
||||
public Color4 ForDifficultyRatingNew(DifficultyRating difficulty)
|
||||
{
|
||||
switch (difficulty)
|
||||
{
|
||||
|
@ -86,8 +86,8 @@ namespace osu.Game.Screens.OnlinePlay.Components
|
||||
minDisplay.Current.Value = minDifficulty;
|
||||
maxDisplay.Current.Value = maxDifficulty;
|
||||
|
||||
minBackground.Colour = colours.ForDifficultyRating(minDifficulty.DifficultyRating, true);
|
||||
maxBackground.Colour = colours.ForDifficultyRating(maxDifficulty.DifficultyRating, true);
|
||||
minBackground.Colour = colours.ForStarDifficulty(minDifficulty.Stars);
|
||||
maxBackground.Colour = colours.ForStarDifficulty(maxDifficulty.Stars);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -107,9 +107,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
string fractionPart = starRatingParts[1];
|
||||
string separator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
|
||||
|
||||
var rating = Current.Value.DifficultyRating;
|
||||
|
||||
background.Colour = colours.ForDifficultyRating(rating, true);
|
||||
background.Colour = colours.ForStarDifficulty(Current.Value.Stars);
|
||||
|
||||
textFlow.Clear();
|
||||
textFlow.AddText($"{wholePart}", s =>
|
||||
|
@ -503,7 +503,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
const float full_opacity_ratio = 0.7f;
|
||||
|
||||
var difficultyColour = colours.ForDifficultyRating(difficulty.DifficultyRating);
|
||||
var difficultyColour = colours.ForStarDifficulty(difficulty.Stars);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user