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-15 16:01:01 +08:00
|
|
|
|
using System;
|
2022-07-04 04:51:30 +08:00
|
|
|
|
using System.Diagnostics;
|
2022-06-29 16:23:35 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Skinning.Legacy
|
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial 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-19 17:08:53 +08:00
|
|
|
|
protected override void OnSliderPress()
|
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 18:29:37 +08:00
|
|
|
|
double remainingTime = Math.Max(0, ParentObject.HitStateUpdateTime - Time.Current);
|
2022-07-15 16:01:01 +08:00
|
|
|
|
|
|
|
|
|
// 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).
|
2024-02-21 15:43:53 +08:00
|
|
|
|
this.ScaleTo(1f).ScaleTo(2f, Math.Min(180f, remainingTime), Easing.Out)
|
2022-07-19 17:08:53 +08:00
|
|
|
|
.FadeTo(0).FadeTo(1f, Math.Min(60f, remainingTime));
|
2022-07-04 04:51:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 10:46:46 +08:00
|
|
|
|
protected override void OnSliderRelease()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-19 17:27:04 +08:00
|
|
|
|
protected override void OnSliderEnd()
|
2022-07-06 12:04:13 +08:00
|
|
|
|
{
|
2022-07-15 16:01:01 +08:00
|
|
|
|
this.ScaleTo(1.6f, 200, Easing.Out)
|
|
|
|
|
.FadeOut(200, Easing.In);
|
2022-07-04 04:51:30 +08:00
|
|
|
|
}
|
2022-07-19 17:08:53 +08:00
|
|
|
|
|
|
|
|
|
protected override void OnSliderTick()
|
|
|
|
|
{
|
2023-11-17 18:09:24 +08:00
|
|
|
|
if (Scale.X >= 2f)
|
|
|
|
|
{
|
|
|
|
|
this.ScaleTo(2.2f)
|
|
|
|
|
.ScaleTo(2f, 200);
|
|
|
|
|
}
|
2022-07-19 17:08:53 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnSliderBreak()
|
|
|
|
|
{
|
|
|
|
|
this.ScaleTo(4f, 100)
|
|
|
|
|
.FadeTo(0f, 100);
|
|
|
|
|
}
|
2022-06-29 16:23:35 +08:00
|
|
|
|
}
|
|
|
|
|
}
|