1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:52:53 +08:00

Merge pull request #21057 from peppy/fix-accent-colour-change-performance-osu-argon

Fix large transform retention when adjusting accent colour of hitobject during pause
This commit is contained in:
Dan Balasescu 2022-11-01 20:00:48 +09:00 committed by GitHub
commit fcf0ad2b99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,12 +121,16 @@ namespace osu.Game.Rulesets.Osu.Skinning.Argon
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))