1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 06:52:56 +08:00

Merge branch 'master' into fix-catch-auto

This commit is contained in:
Dean Herbert 2018-04-04 18:30:55 +09:00 committed by GitHub
commit 13747966a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 2 deletions

View File

@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Osu.Edit
public class OsuEditPlayfield : OsuPlayfield
{
protected override bool ProxyApproachCircles => false;
protected override bool DisplayJudgements => false;
}
}

View File

@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI
// Todo: This should not be a thing, but is currently required for the editor
// https://github.com/ppy/osu-framework/issues/1283
protected virtual bool ProxyApproachCircles => true;
protected virtual bool DisplayJudgements => true;
public static readonly Vector2 BASE_SIZE = new Vector2(512, 384);
@ -73,7 +74,7 @@ namespace osu.Game.Rulesets.Osu.UI
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement)
{
if (!judgedObject.DisplayJudgement)
if (!judgedObject.DisplayJudgement || !DisplayJudgements)
return;
DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgement, judgedObject)

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,13 @@ 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 +88,24 @@ 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;
}
}
}