1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 20:07:29 +08:00

Apply suggested changes

This commit is contained in:
Andrei Zavatski 2019-08-18 16:51:16 +03:00
parent 6c60db550f
commit dd6351b8ca
2 changed files with 18 additions and 16 deletions

View File

@ -27,6 +27,9 @@ namespace osu.Game.Screens.Play.HUD
private const int bar_width = 3;
private const int judgement_line_width = 8;
private const int bar_height = 200;
private const int fade_duration = 200;
private const int arrow_move_duration = 500;
private const int judgement_life_time = 10000;
private const int spacing = 3;
public HitWindows HitWindows { get; set; }
@ -152,11 +155,11 @@ namespace osu.Game.Screens.Play.HUD
switch (type.NewValue)
{
case ScoreMeterType.None:
this.FadeOut(200, Easing.OutQuint);
this.FadeOut(fade_duration, Easing.OutQuint);
break;
case ScoreMeterType.HitError:
this.FadeIn(200, Easing.OutQuint);
this.FadeIn(fade_duration, Easing.OutQuint);
break;
}
}
@ -166,14 +169,13 @@ namespace osu.Game.Screens.Play.HUD
if (!newJudgement.IsHit)
return;
Container judgementLine;
var judgementLine = CreateJudgementLine(newJudgement);
judgementsContainer.Add(judgementLine = CreateJudgementLine(newJudgement));
judgementsContainer.Add(judgementLine);
judgementLine.FadeOut(10000, Easing.OutQuint);
judgementLine.Expire();
judgementLine.FadeOut(judgement_life_time, Easing.OutQuint).Expire();
arrow.MoveToY(calculateArrowPosition(newJudgement), 500, Easing.OutQuint);
arrow.MoveToY(calculateArrowPosition(newJudgement), arrow_move_duration, Easing.OutQuint);
}
protected virtual Container CreateJudgementLine(JudgementResult judgement) => new CircularContainer

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Events;
@ -276,17 +277,16 @@ namespace osu.Game.Screens.Play
ComboCounter?.Current.BindTo(processor.Combo);
HealthDisplay?.Current.BindTo(processor.Health);
if (LeftHitErrorDisplay != null)
{
processor.NewJudgement += LeftHitErrorDisplay.OnNewJudgement;
LeftHitErrorDisplay.HitWindows = processor.CreateHitWindows();
}
var hitWindows = processor.CreateHitWindows();
if (RightHitErrorDisplay != null)
visibilityContainer.ForEach(drawable =>
{
processor.NewJudgement += RightHitErrorDisplay.OnNewJudgement;
RightHitErrorDisplay.HitWindows = processor.CreateHitWindows();
}
if (drawable is HitErrorDisplay)
{
processor.NewJudgement += (drawable as HitErrorDisplay).OnNewJudgement;
(drawable as HitErrorDisplay).HitWindows = hitWindows;
}
});
if (HealthDisplay is StandardHealthDisplay shd)
processor.NewJudgement += shd.Flash;