mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 14:47:18 +08:00
Implement Judgement Colours
This commit is contained in:
parent
cc70f7182a
commit
7fed8d64de
@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
{
|
{
|
||||||
private const float judgement_size = 80;
|
private const float judgement_size = 80;
|
||||||
|
|
||||||
|
private OsuColour colours;
|
||||||
|
|
||||||
protected readonly Judgement Judgement;
|
protected readonly Judgement Judgement;
|
||||||
|
|
||||||
public readonly DrawableHitObject JudgedObject;
|
public readonly DrawableHitObject JudgedObject;
|
||||||
@ -45,11 +47,12 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
|
this.colours = colours;
|
||||||
Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText
|
Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText
|
||||||
{
|
{
|
||||||
Text = Judgement.Result.GetDescription().ToUpper(),
|
Text = Judgement.Result.GetDescription().ToUpper(),
|
||||||
Font = @"Venera",
|
Font = @"Venera",
|
||||||
Colour = Judgement.Result == HitResult.Miss ? colours.Red : Color4.White,
|
Colour = judgementColour(Judgement.Result),
|
||||||
Scale = new Vector2(0.85f, 1),
|
Scale = new Vector2(0.85f, 1),
|
||||||
TextSize = 12
|
TextSize = 12
|
||||||
}, restrictSize: false);
|
}, restrictSize: false);
|
||||||
@ -84,5 +87,27 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
|
|
||||||
Expire(true);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user