From 02fba000bc27355ea901a51cef0527072bbd19a0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 23 Mar 2017 15:07:45 +0900 Subject: [PATCH] Tidy up and tweak transitions of DrawableJudgementInfo. --- .../UI/DrawableTaikoJudgementInfo.cs | 12 ++++----- osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs | 14 +++++----- .../Modes/Judgements/DrawableJudgementInfo.cs | 27 +++++++++++++------ 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgementInfo.cs b/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgementInfo.cs index bb2935b528..87f321d557 100644 --- a/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgementInfo.cs +++ b/osu.Game.Modes.Taiko/UI/DrawableTaikoJudgementInfo.cs @@ -44,16 +44,14 @@ namespace osu.Game.Modes.Taiko.UI protected override void LoadComplete() { - base.LoadComplete(); - - if (Judgement.Result == HitResult.Hit) + switch (Judgement.Result) { - MoveToY(-100, 500); - Delay(250); - FadeOut(250); + case HitResult.Hit: + MoveToY(-100, 500); + break; } - Expire(); + base.LoadComplete(); } } } \ No newline at end of file diff --git a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs index 0ae6fd2c7b..b322e167df 100644 --- a/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs +++ b/osu.Game.Modes.Taiko/UI/TaikoPlayfield.cs @@ -179,19 +179,17 @@ namespace osu.Game.Modes.Taiko.UI public override void OnJudgement(DrawableHitObject judgedObject) { - if (judgedObject.Judgement.Result == HitResult.Hit) - { - hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement)); - } + bool wasHit = judgedObject.Judgement.Result == HitResult.Hit; - float judgementOffset = judgedObject.Judgement.Result == HitResult.Hit ? judgedObject.Position.X : 0; + if (wasHit) + hitExplosionContainer.Add(new HitExplosion(judgedObject.Judgement)); judgementContainer.Add(new DrawableTaikoJudgementInfo(judgedObject.Judgement) { - Anchor = judgedObject.Judgement.Result == HitResult.Hit ? Anchor.TopLeft : Anchor.BottomLeft, - Origin = judgedObject.Judgement.Result == HitResult.Hit ? Anchor.BottomCentre : Anchor.TopCentre, + Anchor = wasHit ? Anchor.TopLeft : Anchor.CentreLeft, + Origin = wasHit ? Anchor.BottomCentre : Anchor.Centre, RelativePositionAxes = Axes.X, - X = judgementOffset, + X = wasHit ? judgedObject.Position.X : 0, }); } } diff --git a/osu.Game/Modes/Judgements/DrawableJudgementInfo.cs b/osu.Game/Modes/Judgements/DrawableJudgementInfo.cs index 0eadec42d8..6cf85fa372 100644 --- a/osu.Game/Modes/Judgements/DrawableJudgementInfo.cs +++ b/osu.Game/Modes/Judgements/DrawableJudgementInfo.cs @@ -25,6 +25,8 @@ namespace osu.Game.Modes.Judgements protected readonly SpriteText JudgementText; + protected double HitVisibleLength => 600; + /// /// Creates a drawable which visualises a . /// @@ -65,18 +67,27 @@ namespace osu.Game.Modes.Judgements { base.LoadComplete(); - if (Judgement.Result == HitResult.Miss) + FadeInFromZero(100, EasingTypes.OutQuint); + + switch (Judgement.Result) { - FadeInFromZero(60); + case HitResult.Miss: + ScaleTo(1.6f); + ScaleTo(1, 100, EasingTypes.In); - ScaleTo(1.6f); - ScaleTo(1, 100, EasingTypes.In); + MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint); + RotateTo(40, 800, EasingTypes.InQuint); - MoveToOffset(new Vector2(0, 100), 800, EasingTypes.InQuint); - RotateTo(40, 800, EasingTypes.InQuint); + Delay(600); + FadeOut(200); + break; + case HitResult.Hit: + ScaleTo(0.9f); + ScaleTo(1, 500, EasingTypes.OutElastic); - Delay(600); - FadeOut(200); + Delay(250); + FadeOut(250, EasingTypes.OutQuint); + break; } Expire();