From e1186080b87436d78a591bb888ff8bfa93559dbf Mon Sep 17 00:00:00 2001 From: OliBomby Date: Sat, 13 Jan 2024 02:24:33 +0100 Subject: [PATCH] simplify scheduling logic --- .../PathControlPointConnectionPiece.cs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointConnectionPiece.cs b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointConnectionPiece.cs index 004a091cae..7e7d653dbd 100644 --- a/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointConnectionPiece.cs +++ b/osu.Game.Rulesets.Osu/Edit/Blueprints/Sliders/Components/PathControlPointConnectionPiece.cs @@ -51,26 +51,14 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components base.LoadComplete(); hitObjectPosition = hitObject.PositionBindable.GetBoundCopy(); - hitObjectPosition.BindValueChanged(_ => pathRequiresUpdate = true); + hitObjectPosition.BindValueChanged(_ => Scheduler.AddOnce(updateConnectingPath)); pathVersion = hitObject.Path.Version.GetBoundCopy(); - pathVersion.BindValueChanged(_ => pathRequiresUpdate = true); + pathVersion.BindValueChanged(_ => Scheduler.AddOnce(updateConnectingPath)); updateConnectingPath(); } - private bool pathRequiresUpdate; - - protected override void Update() - { - base.Update(); - - if (!pathRequiresUpdate) return; - - updateConnectingPath(); - pathRequiresUpdate = false; - } - /// /// Updates the path connecting this control point to the next one. ///