mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 20:32:55 +08: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]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
|
private readonly List<IBindable<PathType?>> pathTypes;
|
||||||
|
|
||||||
private IBindable<int> sliderVersion;
|
private IBindable<int> sliderVersion;
|
||||||
private IBindable<Vector2> sliderPosition;
|
private IBindable<Vector2> sliderPosition;
|
||||||
private IBindable<float> sliderScale;
|
private IBindable<float> sliderScale;
|
||||||
@ -59,8 +61,19 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
{
|
{
|
||||||
this.slider = slider;
|
this.slider = slider;
|
||||||
ControlPoint = controlPoint;
|
ControlPoint = controlPoint;
|
||||||
|
pathTypes = new List<IBindable<PathType?>>();
|
||||||
|
|
||||||
slider.Path.ControlPoints.BindCollectionChanged((_, args) =>
|
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);
|
PointsInSegment = slider.Path.PointsInSegment(controlPoint);
|
||||||
}, runOnceImmediately: true);
|
}, runOnceImmediately: true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user