mirror of
https://github.com/ppy/osu
synced 2025-02-01 10:51:53 +00:00
Merge pull request #19128 from peppy/default-follow-circle-improvements
Adjust default follow circle animations to feel nicer
This commit is contained in:
commit
ec789c2f71
@ -1,10 +1,12 @@
|
||||
// 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.Diagnostics;
|
||||
using osu.Framework.Bindables;
|
||||
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;
|
||||
|
||||
@ -32,19 +34,35 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
|
||||
|
||||
protected override void OnTrackingChanged(ValueChangedEvent<bool> tracking)
|
||||
{
|
||||
const float scale_duration = 300f;
|
||||
const float fade_duration = 300f;
|
||||
Debug.Assert(ParentObject != null);
|
||||
|
||||
this.ScaleTo(tracking.NewValue ? DrawableSliderBall.FOLLOW_AREA : 1f, scale_duration, Easing.OutQuint)
|
||||
.FadeTo(tracking.NewValue ? 1f : 0, fade_duration, Easing.OutQuint);
|
||||
const float duration = 300f;
|
||||
|
||||
if (ParentObject.Judged)
|
||||
return;
|
||||
|
||||
if (tracking.NewValue)
|
||||
{
|
||||
if (Precision.AlmostEquals(0, Alpha))
|
||||
this.ScaleTo(1);
|
||||
|
||||
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA, duration, Easing.OutQuint)
|
||||
.FadeTo(1f, duration, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ScaleTo(DrawableSliderBall.FOLLOW_AREA * 1.2f, duration / 2, Easing.OutQuint)
|
||||
.FadeTo(0, duration / 2, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnSliderEnd()
|
||||
{
|
||||
const float fade_duration = 450f;
|
||||
const float fade_duration = 300;
|
||||
|
||||
// intentionally pile on an extra FadeOut to make it happen much faster
|
||||
this.FadeOut(fade_duration / 4, Easing.Out);
|
||||
this.ScaleTo(1, fade_duration, Easing.OutQuint);
|
||||
this.FadeOut(fade_duration / 2, Easing.OutQuint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user