1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 11:42:56 +08:00

Merge pull request #11992 from peppy/fix-spm-during-fade-out

Fix SPM counter immediately disappearing/decreasing after spinner has already been completed
This commit is contained in:
Dan Balasescu 2021-03-11 22:04:35 +09:00 committed by GitHub
commit 99ef5077c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View File

@ -38,6 +38,11 @@ namespace osu.Game.Rulesets.Osu.Judgements
/// </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.

View File

@ -158,6 +158,17 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
}
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);
@ -262,13 +273,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
base.UpdateAfterChildren();
if (!SpmCounter.IsPresent && RotationTracker.Tracking)
SpmCounter.FadeIn(HitObject.TimeFadeIn);
{
Result.TimeStarted ??= Time.Current;
fadeInCounter();
}
SpmCounter.SetRotation(Result.RateAdjustedRotation);
// 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.
if (Time.Current <= HitObject.EndTime)
SpmCounter.SetRotation(Result.RateAdjustedRotation);
updateBonusScore();
}
private void fadeInCounter() => SpmCounter.FadeIn(HitObject.TimeFadeIn);
private int wholeSpins;
private void updateBonusScore()