mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 18:32:55 +08:00
chore(osu.Game): combine Osu.Colour.{Draw,Text}ForHitResult
into OsuColour.ForHitResult
This commit is contained in:
parent
54f0bb797e
commit
267465df18
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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),
|
||||
}
|
||||
|
@ -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>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user