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(); base.LoadComplete();
complete.BindValueChanged(complete => updateComplete(complete.NewValue, 200)); complete.BindValueChanged(complete => updateDiscColour(complete.NewValue, 200));
drawableSpinner.ApplyCustomUpdateState += updateStateTransforms; drawableSpinner.ApplyCustomUpdateState += updateStateTransforms;
updateStateTransforms(drawableSpinner, drawableSpinner.State.Value); updateStateTransforms(drawableSpinner, drawableSpinner.State.Value);
@ -137,6 +137,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
this.ScaleTo(initial_scale); this.ScaleTo(initial_scale);
this.RotateTo(0); this.RotateTo(0);
updateDiscColour(false);
using (BeginDelayedSequence(spinner.TimePreempt / 2)) using (BeginDelayedSequence(spinner.TimePreempt / 2))
{ {
// constant ambient rotation to give the spinner "spinning" character. // 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. if (drawableSpinner.Result?.TimeCompleted is double completionTime)
using (BeginAbsoluteSequence(spinner.StartTime - spinner.TimePreempt)) {
updateComplete(state == ArmedState.Hit, 0); 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; var colour = complete ? completeColour : normalColour;