mirror of
https://github.com/ppy/osu.git
synced 2025-01-08 00:42:57 +08:00
Move judgement colours to OsuColour
This commit is contained in:
parent
ed419216f0
commit
5f09c70f75
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
@ -67,6 +68,32 @@ namespace osu.Game.Graphics
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Retrieves the colour for a <see cref="HitResult"/>.
|
||||||
|
/// </summary>
|
||||||
|
public Color4 ForHitResult(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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// See https://github.com/ppy/osu-web/blob/master/resources/assets/less/colors.less
|
// See https://github.com/ppy/osu-web/blob/master/resources/assets/less/colors.less
|
||||||
public readonly Color4 PurpleLighter = Color4Extensions.FromHex(@"eeeeff");
|
public readonly Color4 PurpleLighter = Color4Extensions.FromHex(@"eeeeff");
|
||||||
public readonly Color4 PurpleLight = Color4Extensions.FromHex(@"aa88ff");
|
public readonly Color4 PurpleLight = Color4Extensions.FromHex(@"aa88ff");
|
||||||
|
@ -12,7 +12,6 @@ using osu.Game.Graphics.Sprites;
|
|||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Judgements
|
namespace osu.Game.Rulesets.Judgements
|
||||||
{
|
{
|
||||||
@ -68,7 +67,7 @@ namespace osu.Game.Rulesets.Judgements
|
|||||||
{
|
{
|
||||||
Text = Result.Type.GetDescription().ToUpperInvariant(),
|
Text = Result.Type.GetDescription().ToUpperInvariant(),
|
||||||
Font = OsuFont.Numeric.With(size: 20),
|
Font = OsuFont.Numeric.With(size: 20),
|
||||||
Colour = judgementColour(Result.Type),
|
Colour = colours.ForHitResult(Result.Type),
|
||||||
Scale = new Vector2(0.85f, 1),
|
Scale = new Vector2(0.85f, 1),
|
||||||
}, confineMode: ConfineMode.NoScaling)
|
}, confineMode: ConfineMode.NoScaling)
|
||||||
};
|
};
|
||||||
@ -110,28 +109,5 @@ 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;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return Color4.White;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user