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

Ensure the follow circle is in the correct state before animations in the tail leniency region

This commit is contained in:
Detze 2024-02-29 05:27:10 +01:00
parent aa6b68ccbd
commit 729a7b0c89
4 changed files with 33 additions and 26 deletions

View File

@ -10,7 +10,6 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning.Argon
@ -66,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
if (Precision.AlmostEquals(0, Alpha))
this.ScaleTo(1);
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA, duration, Easing.OutQuint)
this.ScaleTo(FollowAreaScale, duration, Easing.OutQuint)
.FadeIn(duration, Easing.OutQuint);
}
@ -74,7 +73,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
{
const float duration = 150;
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.2f, duration, Easing.OutQuint)
this.ScaleTo(FollowAreaScale * 1.2f, duration, Easing.OutQuint)
.FadeTo(0, duration, Easing.OutQuint);
}
@ -88,11 +87,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
protected override void OnSliderTick()
{
if (Scale.X >= DrawableSliderBall.FOLLOW_AREA * 0.98f)
if (Scale.X >= FollowAreaScale * 0.98f)
{
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.08f, 40, Easing.OutQuint)
this.ScaleTo(FollowAreaScale * 1.08f, 40, Easing.OutQuint)
.Then()
.ScaleTo(DrawableSliderBall.FOLLOW_AREA, 200f, Easing.OutQuint);
.ScaleTo(FollowAreaScale, 200f, Easing.OutQuint);
}
}

View File

@ -5,7 +5,6 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Utils;
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osuTK.Graphics;
namespace osu.Game.Rulesets.Osu.Skinning.Default
@ -37,7 +36,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
if (Precision.AlmostEquals(0, Alpha))
this.ScaleTo(1);
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA, duration, Easing.OutQuint)
this.ScaleTo(FollowAreaScale, duration, Easing.OutQuint)
.FadeIn(duration, Easing.OutQuint);
}
@ -45,7 +44,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
const float duration = 150;
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.2f, duration, Easing.OutQuint)
this.ScaleTo(FollowAreaScale * 1.2f, duration, Easing.OutQuint)
.FadeTo(0, duration, Easing.OutQuint);
}
@ -59,11 +58,11 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
protected override void OnSliderTick()
{
if (Scale.X >= DrawableSliderBall.FOLLOW_AREA * 0.98f)
if (Scale.X >= FollowAreaScale * 0.98f)
{
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.08f, 40, Easing.OutQuint)
this.ScaleTo(FollowAreaScale * 1.08f, 40, Easing.OutQuint)
.Then()
.ScaleTo(DrawableSliderBall.FOLLOW_AREA, 200f, Easing.OutQuint);
.ScaleTo(FollowAreaScale, 200f, Easing.OutQuint);
}
}

View File

@ -71,18 +71,14 @@ namespace osu.Game.Rulesets.Osu.Skinning
else
{
if (tracking.NewValue)
{
toPressedState();
OnSliderEnd();
}
}
}
}
private bool isInTailLeniencyRegion()
{
Debug.Assert(ParentObject != null);
return Time.Current >= ParentObject.HitStateUpdateTime + SliderEventGenerator.TAIL_LENIENCY;
}
private void updateStateTransforms(DrawableHitObject drawableObject, ArmedState state)
{
Debug.Assert(ParentObject != null);
@ -138,6 +134,17 @@ namespace osu.Game.Rulesets.Osu.Skinning
}
}
private void toPressedState() => this.ScaleTo(FollowAreaScale).FadeTo(1f);
private bool isInTailLeniencyRegion()
{
Debug.Assert(ParentObject != null);
return Time.Current >= ParentObject.HitStateUpdateTime + SliderEventGenerator.TAIL_LENIENCY;
}
protected virtual float FollowAreaScale => DrawableSliderBall.FOLLOW_AREA;
protected abstract void OnSliderPress();
protected abstract void OnSliderRelease();

View File

@ -20,15 +20,17 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
InternalChild = animationContent;
}
// Note that the scale adjust here is 2 instead of DrawableSliderBall.FOLLOW_AREA to match legacy behaviour.
// This means the actual tracking area for gameplay purposes is larger than the sprite (but skins may be accounting for this).
protected override float FollowAreaScale => 2f;
protected override void OnSliderPress()
{
Debug.Assert(ParentObject != null);
double remainingTime = Math.Max(0, ParentObject.HitStateUpdateTime - Time.Current);
// Note that the scale adjust here is 2 instead of DrawableSliderBall.FOLLOW_AREA to match legacy behaviour.
// This means the actual tracking area for gameplay purposes is larger than the sprite (but skins may be accounting for this).
this.ScaleTo(1f).ScaleTo(2f, Math.Min(180f, remainingTime), Easing.Out)
this.ScaleTo(1f).ScaleTo(FollowAreaScale, Math.Min(180f, remainingTime), Easing.Out)
.FadeTo(0).FadeTo(1f, Math.Min(60f, remainingTime));
}
@ -38,7 +40,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
protected override void OnSliderEnd()
{
this.ScaleTo(1.6f, 200, Easing.Out)
this.ScaleTo(FollowAreaScale * 0.8f, 200, Easing.Out)
.FadeOut(200, Easing.In);
}
@ -46,14 +48,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
{
if (Scale.X >= 2f)
{
this.ScaleTo(2.2f)
.ScaleTo(2f, 200);
this.ScaleTo(FollowAreaScale * 1.1f)
.ScaleTo(FollowAreaScale, 200);
}
}
protected override void OnSliderBreak()
{
this.ScaleTo(4f, 100)
this.ScaleTo(FollowAreaScale * 2f, 100)
.FadeTo(0f, 100);
}
}