2022-06-29 16:23:35 +08:00
|
|
|
|
// 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.
|
|
|
|
|
|
2022-07-04 04:51:30 +08:00
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using osu.Framework.Bindables;
|
2022-06-29 16:23:35 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2022-07-04 04:51:30 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2022-06-29 16:23:35 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|
|
|
|
{
|
2022-07-15 07:52:45 +08:00
|
|
|
|
public class LegacyFollowCircle : FollowCircle
|
2022-06-29 16:23:35 +08:00
|
|
|
|
{
|
|
|
|
|
public LegacyFollowCircle(Drawable animationContent)
|
|
|
|
|
{
|
|
|
|
|
// follow circles are 2x the hitcircle resolution in legacy skins (since they are scaled down from >1x
|
|
|
|
|
animationContent.Scale *= 0.5f;
|
|
|
|
|
animationContent.Anchor = Anchor.Centre;
|
|
|
|
|
animationContent.Origin = Anchor.Centre;
|
|
|
|
|
|
|
|
|
|
RelativeSizeAxes = Axes.Both;
|
|
|
|
|
InternalChild = animationContent;
|
|
|
|
|
}
|
2022-07-04 04:51:30 +08:00
|
|
|
|
|
2022-07-15 07:52:45 +08:00
|
|
|
|
protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
|
2022-07-04 04:51:30 +08:00
|
|
|
|
{
|
2022-07-15 07:52:45 +08:00
|
|
|
|
Debug.Assert(ParentObject != null);
|
2022-07-04 04:51:30 +08:00
|
|
|
|
|
2022-07-15 07:52:45 +08:00
|
|
|
|
if (ParentObject.Judged)
|
2022-07-04 04:51:30 +08:00
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
const float scale_duration = 180f;
|
|
|
|
|
const float fade_duration = 90f;
|
|
|
|
|
|
2022-07-15 07:52:45 +08:00
|
|
|
|
double maxScaleDuration = ParentObject.HitStateUpdateTime - Time.Current;
|
2022-07-04 04:51:30 +08:00
|
|
|
|
double realScaleDuration = scale_duration;
|
2022-07-08 11:30:31 +08:00
|
|
|
|
if (tracking.NewValue && maxScaleDuration < realScaleDuration && maxScaleDuration >= 0)
|
2022-07-04 04:51:30 +08:00
|
|
|
|
realScaleDuration = maxScaleDuration;
|
|
|
|
|
double realFadeDuration = fade_duration * realScaleDuration / fade_duration;
|
|
|
|
|
|
|
|
|
|
this.ScaleTo(tracking.NewValue ? DrawableSliderBall.FOLLOW_AREA : 1f, realScaleDuration, Easing.OutQuad)
|
|
|
|
|
.FadeTo(tracking.NewValue ? 1f : 0f, realFadeDuration, Easing.OutQuad);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-15 07:52:45 +08:00
|
|
|
|
protected override void OnSliderEnd()
|
2022-07-06 12:04:13 +08:00
|
|
|
|
{
|
2022-07-04 04:51:30 +08:00
|
|
|
|
const float shrink_duration = 200f;
|
2022-07-06 12:04:13 +08:00
|
|
|
|
const float fade_delay = 175f;
|
|
|
|
|
const float fade_duration = 35f;
|
2022-07-04 04:51:30 +08:00
|
|
|
|
|
2022-07-15 07:52:45 +08:00
|
|
|
|
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 0.75f, shrink_duration, Easing.OutQuad)
|
|
|
|
|
.Delay(fade_delay)
|
|
|
|
|
.FadeOut(fade_duration);
|
2022-07-04 04:51:30 +08:00
|
|
|
|
}
|
2022-06-29 16:23:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|