1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 15:47:26 +08:00

Implement Judgement Colours

This commit is contained in:
Ali Rizvi 2018-03-31 04:59:08 +09:00
parent cc70f7182a
commit 7fed8d64de

View File

@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Judgements
{
private const float judgement_size = 80;
private OsuColour colours;
protected readonly Judgement Judgement;
public readonly DrawableHitObject JudgedObject;
@ -45,11 +47,12 @@ namespace osu.Game.Rulesets.Judgements
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
this.colours = colours;
Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText
{
Text = Judgement.Result.GetDescription().ToUpper(),
Font = @"Venera",
Colour = Judgement.Result == HitResult.Miss ? colours.Red : Color4.White,
Colour = judgementColour(Judgement.Result),
Scale = new Vector2(0.85f, 1),
TextSize = 12
}, restrictSize: false);
@ -84,5 +87,27 @@ namespace osu.Game.Rulesets.Judgements
Expire(true);
}
private Color4 judgementColour(HitResult judgement)
{
switch (judgement)
{
case HitResult.Perfect:
case HitResult.Great:
return colours.Blue;
case HitResult.Ok:
case HitResult.Good:
return colours.Green;
case HitResult.Meh:
return colours.Yellow;
case HitResult.Miss:
return colours.Red;
}
return Color4.White;
}
}
}