1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 14:53:21 +08:00

chore(osu.Game): combine Osu.Colour.{Draw,Text}ForHitResult into OsuColour.ForHitResult

This commit is contained in:
Acid Chicken (硫酸鶏) 2022-09-07 23:34:46 +09:00
parent 54f0bb797e
commit 267465df18
No known key found for this signature in database
GPG Key ID: 3E87B98A3F6BAB99
6 changed files with 6 additions and 29 deletions

View File

@ -102,30 +102,7 @@ namespace osu.Game.Graphics
/// <summary>
/// Retrieves the colour for a <see cref="HitResult"/>.
/// </summary>
public Color4 TextForHitResult(HitResult judgement)
{
switch (judgement)
{
case HitResult.Perfect:
case HitResult.Great:
return Blue;
case HitResult.Ok:
case HitResult.Good:
return Green;
case HitResult.Meh:
return Yellow;
case HitResult.Miss:
return Red;
default:
return Color4.White;
}
}
public Color4 DrawForHitResult(HitResult result)
public Color4 ForHitResult(HitResult result)
{
switch (result)
{

View File

@ -156,7 +156,7 @@ namespace osu.Game.Online.Leaderboards
{
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.SemiBold),
Text = displayName.ToUpper(),
Colour = colours.TextForHitResult(result),
Colour = colours.ForHitResult(result),
},
new OsuSpriteText
{

View File

@ -42,7 +42,7 @@ namespace osu.Game.Rulesets.Judgements
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Text = Result.GetDescription().ToUpperInvariant(),
Colour = colours.TextForHitResult(Result),
Colour = colours.ForHitResult(Result),
Font = OsuFont.Numeric.With(size: 20),
Scale = new Vector2(0.85f, 1),
}

View File

@ -59,7 +59,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
protected Color4 GetColourForHitResult(HitResult result)
{
return colours.DrawForHitResult(result);
return colours.ForHitResult(result);
}
/// <summary>

View File

@ -23,7 +23,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
HeaderText.Colour = colours.TextForHitResult(Result);
HeaderText.Colour = colours.ForHitResult(Result);
}
}
}

View File

@ -243,7 +243,7 @@ namespace osu.Game.Screens.Ranking.Statistics
RelativeSizeAxes = Axes.Both,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Colour = isCentre && i == 0 ? Color4.White : colours.DrawForHitResult(v.Key),
Colour = isCentre && i == 0 ? Color4.White : colours.ForHitResult(v.Key),
Height = 0,
}).ToArray();
// The bars of the stacked bar graph will be processed (stacked) from the bottom, which is the base position,