1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 17:27:39 +08:00

Merge pull request #19007 from goodtrailer/fix-rewind-spinner-accent

Fix default spinner's accent on rewind in user replays
This commit is contained in:
Dean Herbert 2022-07-07 17:13:08 +09:00 committed by GitHub
commit 2eba38ca88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{
base.LoadComplete();
complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200));
complete.BindValueChanged(complete => updateDiscColour(complete.NewValue, 200));
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
updateStateTransforms(drawableSpinner, drawableSpinner.State.Value);
@ -137,6 +137,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
this.ScaleTo(initial_scale);
this.RotateTo(0);
updateDiscColour(false);
using (BeginDelayedSequence(spinner.TimePreempt / 2))
{
// constant ambient rotation to give the spinner "spinning" character.
@ -177,12 +179,14 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
}
}
// transforms we have from completing the spinner will be rolled back, so reapply immediately.
using (BeginAbsoluteSequence(spinner.StartTime - spinner.TimePreempt))
updateComplete(state == ArmedState.Hit, 0);
if (drawableSpinner.Result?.TimeCompleted is double completionTime)
{
using (BeginAbsoluteSequence(completionTime))
updateDiscColour(true, 200);
}
}
private void updateComplete(bool complete, double duration)
private void updateDiscColour(bool complete, double duration = 0)
{
var colour = complete ? completeColour : normalColour;