mirror of
https://github.com/ppy/osu
synced 2024-12-14 02:46:27 +00:00
Track path type changes for PointsInSegment
This commit is contained in:
parent
9d02930709
commit
b8ab1c7682
@ -50,6 +50,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
private readonly List<IBindable<PathType?>> pathTypes;
|
||||
|
||||
private IBindable<int> sliderVersion;
|
||||
private IBindable<Vector2> sliderPosition;
|
||||
private IBindable<float> sliderScale;
|
||||
@ -59,8 +61,19 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
{
|
||||
this.slider = slider;
|
||||
ControlPoint = controlPoint;
|
||||
pathTypes = new List<IBindable<PathType?>>();
|
||||
|
||||
slider.Path.ControlPoints.BindCollectionChanged((_, args) =>
|
||||
{
|
||||
pathTypes.Clear();
|
||||
|
||||
foreach (var point in slider.Path.ControlPoints)
|
||||
{
|
||||
IBindable<PathType?> boundTypeCopy = point.Type.GetBoundCopy();
|
||||
pathTypes.Add(boundTypeCopy);
|
||||
boundTypeCopy.BindValueChanged(_ => PointsInSegment = slider.Path.PointsInSegment(controlPoint));
|
||||
}
|
||||
|
||||
PointsInSegment = slider.Path.PointsInSegment(controlPoint);
|
||||
}, runOnceImmediately: true);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user