mirror of https://github.com/ppy/osu
Move spin start time to inside result and switch to standard state handling
This commit is contained in:
parent
4e8bcc9265
commit
1591d593e2
|
@ -38,6 +38,11 @@ public class OsuSpinnerJudgementResult : OsuJudgementResult
|
|||
/// </example>
|
||||
public float RateAdjustedRotation;
|
||||
|
||||
/// <summary>
|
||||
/// Time instant at which the spin was started (the first user input which caused an increase in spin).
|
||||
/// </summary>
|
||||
public double? TimeStarted;
|
||||
|
||||
/// <summary>
|
||||
/// Time instant at which the spinner has been completed (the user has executed all required spins).
|
||||
/// Will be null if all required spins haven't been completed.
|
||||
|
|
|
@ -109,9 +109,6 @@ protected override void OnFree()
|
|||
base.OnFree();
|
||||
|
||||
spinningSample.Samples = null;
|
||||
|
||||
// the counter handles its own fade in (when spinning begins) so we should only be responsible for resetting it here, for pooling.
|
||||
SpmCounter.Hide();
|
||||
}
|
||||
|
||||
protected override void LoadSamples()
|
||||
|
@ -161,6 +158,17 @@ protected override void AddNestedHitObject(DrawableHitObject hitObject)
|
|||
}
|
||||
}
|
||||
|
||||
protected override void UpdateStartTimeStateTransforms()
|
||||
{
|
||||
base.UpdateStartTimeStateTransforms();
|
||||
|
||||
if (Result?.TimeStarted is double startTime)
|
||||
{
|
||||
using (BeginAbsoluteSequence(startTime))
|
||||
fadeInCounter();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateHitStateTransforms(ArmedState state)
|
||||
{
|
||||
base.UpdateHitStateTransforms(state);
|
||||
|
@ -265,7 +273,10 @@ protected override void UpdateAfterChildren()
|
|||
base.UpdateAfterChildren();
|
||||
|
||||
if (!SpmCounter.IsPresent && RotationTracker.Tracking)
|
||||
SpmCounter.FadeIn(HitObject.TimeFadeIn);
|
||||
{
|
||||
Result.TimeStarted ??= Time.Current;
|
||||
fadeInCounter();
|
||||
}
|
||||
|
||||
// don't update after end time to avoid the rate display dropping during fade out.
|
||||
// this shouldn't be limited to StartTime as it causes weirdness with the underlying calculation, which is expecting updates during that period.
|
||||
|
@ -275,6 +286,8 @@ protected override void UpdateAfterChildren()
|
|||
updateBonusScore();
|
||||
}
|
||||
|
||||
private void fadeInCounter() => SpmCounter.FadeIn(HitObject.TimeFadeIn);
|
||||
|
||||
private int wholeSpins;
|
||||
|
||||
private void updateBonusScore()
|
||||
|
|
|
@ -21,11 +21,6 @@ public class SpinnerSpmCounter : Container
|
|||
|
||||
private readonly OsuSpriteText spmText;
|
||||
|
||||
public override void ApplyTransformsAt(double time, bool propagateChildren = false)
|
||||
{
|
||||
// handles own fade in state.
|
||||
}
|
||||
|
||||
public SpinnerSpmCounter()
|
||||
{
|
||||
Children = new Drawable[]
|
||||
|
|
Loading…
Reference in New Issue