1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 09:03:00 +08:00

Move follow circle tracking to DrawableSliderHead

This commit is contained in:
smoogipoo 2021-02-05 17:33:48 +09:00
parent ee3367d7c5
commit a5855f5d28
4 changed files with 18 additions and 13 deletions

View File

@ -50,10 +50,7 @@ namespace osu.Game.Rulesets.Osu.Mods
slider.IgnoreJudgement = !DisableSliderHeadJudgement.Value;
foreach (var head in slider.NestedHitObjects.OfType<SliderHeadCircle>())
{
head.TrackFollowCircle = !DisableSliderHeadTracking.Value;
head.JudgeAsNormalHitCircle = !DisableSliderHeadJudgement.Value;
}
break;
}
@ -71,8 +68,16 @@ namespace osu.Game.Rulesets.Osu.Mods
{
foreach (var obj in drawables)
{
if (obj is DrawableSlider slider)
slider.Ball.TrackVisualSize = !DisableExactFollowCircleTracking.Value;
switch (obj)
{
case DrawableSlider slider:
slider.Ball.TrackVisualSize = !DisableExactFollowCircleTracking.Value;
break;
case DrawableSliderHead head:
head.TrackFollowCircle = !DisableSliderHeadTracking.Value;
break;
}
}
}
}

View File

@ -22,6 +22,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
public override bool DisplayResult => HitObject?.JudgeAsNormalHitCircle ?? base.DisplayResult;
/// <summary>
/// Makes this <see cref="DrawableSliderHead"/> track the follow circle when the start time is reached.
/// If <c>false</c>, this <see cref="DrawableSliderHead"/> will be pinned to its initial position in the slider.
/// </summary>
public bool TrackFollowCircle = true;
private readonly IBindable<int> pathVersion = new Bindable<int>();
protected override OsuSkinComponents CirclePieceComponent => OsuSkinComponents.SliderHeadHitCircle;
@ -66,7 +72,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
Debug.Assert(Slider != null);
Debug.Assert(HitObject != null);
if (HitObject.TrackFollowCircle)
if (TrackFollowCircle)
{
double completionProgress = Math.Clamp((Time.Current - Slider.StartTime) / Slider.Duration, 0, 1);

View File

@ -8,12 +8,6 @@ namespace osu.Game.Rulesets.Osu.Objects
{
public class SliderHeadCircle : HitCircle
{
/// <summary>
/// Makes this <see cref="SliderHeadCircle"/> track the follow circle when the start time is reached.
/// If <c>false</c>, this <see cref="SliderHeadCircle"/> will be pinned to its initial position in the slider.
/// </summary>
public bool TrackFollowCircle = true;
/// <summary>
/// Whether to treat this <see cref="SliderHeadCircle"/> as a normal <see cref="HitCircle"/> for judgement purposes.
/// If <c>false</c>, judgement will be ignored.

View File

@ -54,7 +54,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
if (drawableSlider.HitObject == null)
return;
if (!drawableSlider.HitObject.HeadCircle.TrackFollowCircle)
if (!drawableSlider.HeadCircle.TrackFollowCircle)
{
// When not tracking the follow circle, force the path to not snake out as it looks better that way.
SnakingOut.UnbindFrom(snakingOut);