Skip to content

Commit

Permalink
Merge pull request #21057 from peppy/fix-accent-colour-change-perform…
Browse files Browse the repository at this point in the history
…ance-osu-argon

Fix large transform retention when adjusting accent colour of hitobject during pause
  • Loading branch information
smoogipoo authored Nov 1, 2022
2 parents ddb3d83 + ff60eeb commit fcf0ad2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osu.Game.Rulesets.Osu/Skinning/Argon/ArgonMainCirclePiece.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,16 @@ protected override void LoadComplete()
innerGradient.Colour = ColourInfo.GradientVertical(colour.NewValue.Darken(0.5f), colour.NewValue.Darken(0.6f));
flash.Colour = colour.NewValue;
updateStateTransforms(drawableObject, drawableObject.State.Value);
// Accent colour may be changed many times during a paused gameplay state.
// Schedule the change to avoid transforms piling up.
Scheduler.AddOnce(updateStateTransforms);
}, true);

drawableObject.ApplyCustomUpdateState += updateStateTransforms;
}

private void updateStateTransforms() => updateStateTransforms(drawableObject, drawableObject.State.Value);

private void updateStateTransforms(DrawableHitObject drawableHitObject, ArmedState state)
{
using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime))
Expand Down

0 comments on commit fcf0ad2

Please sign in to comment.