Use DrawableSliderTail instead of DrawableSlider

This commit is contained in:
Alden Wu
2022-07-20 18:07:02 -07:00
parent 5cb0920cfb
commit 23fd514ca3
2 changed files with 9 additions and 6 deletions

View File

@ -58,13 +58,14 @@ namespace osu.Game.Rulesets.Osu.Skinning
private void updateStateTransforms(DrawableHitObject drawableObject, ArmedState state)
{
// We only want DrawableSlider here. DrawableSliderTail doesn't quite work because its
// HitStateUpdateTime is ~36ms before DrawableSlider's HitStateUpdateTime (aka slider
// end leniency).
if (drawableObject is not DrawableSlider)
if (drawableObject is not DrawableSliderTail)
return;
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
Debug.Assert(ParentObject != null);
// Use ParentObject instead of drawableObject because slider tail hit state update time
// is ~36ms before the actual slider end (aka slider tail leniency)
using (BeginAbsoluteSequence(ParentObject.HitStateUpdateTime))
{
switch (state)
{

View File

@ -18,6 +18,8 @@ namespace osu.Game.Rulesets.Osu.Skinning
private void updateStateTransforms(DrawableHitObject drawableObject, ArmedState state)
{
// Fine to use drawableObject.HitStateUpdateTime even for DrawableSliderTail, since on
// stable, the break anim plays right when the tail is missed, not when the slider ends
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
{
switch (state)
@ -28,7 +30,7 @@ namespace osu.Game.Rulesets.Osu.Skinning
break;
case ArmedState.Miss:
if (drawableObject is DrawableSlider or DrawableSliderTick or DrawableSliderRepeat)
if (drawableObject is DrawableSliderTail or DrawableSliderTick or DrawableSliderRepeat)
OnSliderBreak();
break;
}