1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 20:13:21 +08:00

simplify scheduling logic

This commit is contained in:
OliBomby 2024-01-13 02:24:33 +01:00
parent 5fa7f6ec53
commit e1186080b8

View File

@ -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;
}
/// <summary>
/// Updates the path connecting this control point to the next one.
/// </summary>