mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 12:45:09 +08:00
Remove fades from DrawableJudgement itself
This commit is contained in:
parent
5bd4ace37f
commit
94886a09b2
@ -19,15 +19,14 @@ namespace osu.Game.Rulesets.Mania.UI
|
||||
{
|
||||
}
|
||||
|
||||
protected override double FadeInDuration => 50;
|
||||
|
||||
protected override void ApplyHitAnimations()
|
||||
{
|
||||
JudgementBody.ScaleTo(0.8f);
|
||||
JudgementBody.ScaleTo(1, 250, Easing.OutElastic);
|
||||
|
||||
JudgementBody.Delay(FadeInDuration).ScaleTo(0.75f, 250);
|
||||
this.Delay(FadeInDuration).FadeOut(200);
|
||||
JudgementBody.Delay(50)
|
||||
.ScaleTo(0.75f, 250)
|
||||
.FadeOut(200);
|
||||
}
|
||||
|
||||
protected override Drawable CreateDefaultJudgement(HitResult result) => new ManiaJudgementPiece(result);
|
||||
|
@ -44,26 +44,18 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
}
|
||||
}
|
||||
|
||||
private double fadeOutDelay;
|
||||
protected override double FadeOutDelay => fadeOutDelay;
|
||||
|
||||
protected override void ApplyHitAnimations()
|
||||
{
|
||||
bool hitLightingEnabled = config.Get<bool>(OsuSetting.HitLighting);
|
||||
|
||||
if (hitLightingEnabled)
|
||||
{
|
||||
JudgementBody.FadeIn().Delay(FadeInDuration).FadeOut(400);
|
||||
|
||||
Lighting.ScaleTo(0.8f).ScaleTo(1.2f, 600, Easing.Out);
|
||||
Lighting.FadeIn(200).Then().Delay(200).FadeOut(1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
JudgementBody.Alpha = 1;
|
||||
}
|
||||
|
||||
fadeOutDelay = hitLightingEnabled ? 1400 : base.FadeOutDelay;
|
||||
// extend the lifetime to cover lighting fade
|
||||
LifetimeEnd = 1400;
|
||||
}
|
||||
|
||||
base.ApplyHitAnimations();
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using JetBrains.Annotations;
|
||||
using osu.Framework.Allocation;
|
||||
@ -32,11 +33,13 @@ namespace osu.Game.Rulesets.Judgements
|
||||
/// <summary>
|
||||
/// Duration of initial fade in.
|
||||
/// </summary>
|
||||
[Obsolete("Apply any animations manually via ApplyHitAnimations / ApplyMissAnimations. Defaults were moved inside skinned components.")]
|
||||
protected virtual double FadeInDuration => 100;
|
||||
|
||||
/// <summary>
|
||||
/// Duration to wait until fade out begins. Defaults to <see cref="FadeInDuration"/>.
|
||||
/// </summary>
|
||||
[Obsolete("Apply any animations manually via ApplyHitAnimations / ApplyMissAnimations. Defaults were moved inside skinned components.")]
|
||||
protected virtual double FadeOutDelay => FadeInDuration;
|
||||
|
||||
/// <summary>
|
||||
@ -73,7 +76,6 @@ namespace osu.Game.Rulesets.Judgements
|
||||
/// </remarks>
|
||||
protected virtual void ApplyHitAnimations()
|
||||
{
|
||||
this.Delay(FadeOutDelay).FadeOut(400);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -112,8 +114,6 @@ namespace osu.Game.Rulesets.Judgements
|
||||
// not sure if this should remain going forward.
|
||||
skinnableJudgement.ResetAnimation();
|
||||
|
||||
this.FadeInFromZero(FadeInDuration, Easing.OutQuint);
|
||||
|
||||
switch (Result.Type)
|
||||
{
|
||||
case HitResult.None:
|
||||
@ -134,7 +134,10 @@ namespace osu.Game.Rulesets.Judgements
|
||||
animatable.PlayAnimation();
|
||||
}
|
||||
|
||||
Expire(true);
|
||||
JudgementBody.Expire(true);
|
||||
|
||||
LifetimeStart = JudgementBody.LifetimeStart;
|
||||
LifetimeEnd = JudgementBody.LifetimeEnd;
|
||||
}
|
||||
|
||||
private HitResult? currentDrawableType;
|
||||
|
Loading…
Reference in New Issue
Block a user