mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 01:02:56 +08:00
Add flag to toggle follow circle tracking for slider heads
This commit is contained in:
parent
19cbcd556c
commit
623b47f9af
@ -12,6 +12,8 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
{
|
||||
public class DrawableSliderHead : DrawableHitCircle
|
||||
{
|
||||
public new SliderHeadCircle HitObject => (SliderHeadCircle)base.HitObject;
|
||||
|
||||
[CanBeNull]
|
||||
public Slider Slider => DrawableSlider?.HitObject;
|
||||
|
||||
@ -59,12 +61,16 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
|
||||
base.Update();
|
||||
|
||||
Debug.Assert(Slider != null);
|
||||
Debug.Assert(HitObject != null);
|
||||
|
||||
double completionProgress = Math.Clamp((Time.Current - Slider.StartTime) / Slider.Duration, 0, 1);
|
||||
if (HitObject.TrackFollowCircle)
|
||||
{
|
||||
double completionProgress = Math.Clamp((Time.Current - Slider.StartTime) / Slider.Duration, 0, 1);
|
||||
|
||||
//todo: we probably want to reconsider this before adding scoring, but it looks and feels nice.
|
||||
if (!IsHit)
|
||||
Position = Slider.CurvePositionAt(completionProgress);
|
||||
//todo: we probably want to reconsider this before adding scoring, but it looks and feels nice.
|
||||
if (!IsHit)
|
||||
Position = Slider.CurvePositionAt(completionProgress);
|
||||
}
|
||||
}
|
||||
|
||||
public Action<double> OnShake;
|
||||
|
@ -5,5 +5,9 @@ namespace osu.Game.Rulesets.Osu.Objects
|
||||
{
|
||||
public class SliderHeadCircle : HitCircle
|
||||
{
|
||||
/// <summary>
|
||||
/// Makes the head circle track the follow circle when the start time is reached.
|
||||
/// </summary>
|
||||
public bool TrackFollowCircle = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user