Use latest slider velocity for juice stream velocity computation.

This fixes one-frame glitch in editor when slider velocity is changed.
This commit is contained in:
ekrctb 2022-05-08 21:32:05 +09:00
parent 0e98bb28bd
commit 670922c8e5
1 changed files with 10 additions and 6 deletions

View File

@ -27,10 +27,16 @@ public class JuiceStream : CatchHitObject, IHasPathWithRepeats
public int RepeatCount { get; set; }
[JsonIgnore]
public double Velocity { get; private set; }
private double velocityFactor;
[JsonIgnore]
public double TickDistance { get; private set; }
private double tickDistanceFactor;
[JsonIgnore]
public double Velocity => velocityFactor * DifficultyControlPoint.SliderVelocity;
[JsonIgnore]
public double TickDistance => tickDistanceFactor * DifficultyControlPoint.SliderVelocity;
/// <summary>
/// The length of one span of this <see cref="JuiceStream"/>.
@ -43,10 +49,8 @@ protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, I
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * DifficultyControlPoint.SliderVelocity;
Velocity = scoringDistance / timingPoint.BeatLength;
TickDistance = scoringDistance / difficulty.SliderTickRate;
velocityFactor = base_scoring_distance * difficulty.SliderMultiplier / timingPoint.BeatLength;
tickDistanceFactor = base_scoring_distance * difficulty.SliderMultiplier / difficulty.SliderTickRate;
}
protected override void CreateNestedHitObjects(CancellationToken cancellationToken)