mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Separate path connections from control points
This commit is contained in:
@ -25,6 +25,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
public class PathControlPointVisualiser : CompositeDrawable, IKeyBindingHandler<PlatformAction>, IHasContextMenu
|
||||
{
|
||||
internal readonly Container<PathControlPointPiece> Pieces;
|
||||
|
||||
private readonly Container<PathControlPointConnection> connections;
|
||||
private readonly Slider slider;
|
||||
private readonly bool allowSelection;
|
||||
|
||||
@ -42,7 +44,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
InternalChild = Pieces = new Container<PathControlPointPiece> { RelativeSizeAxes = Axes.Both };
|
||||
InternalChildren = new Drawable[]
|
||||
{
|
||||
connections = new Container<PathControlPointConnection> { RelativeSizeAxes = Axes.Both },
|
||||
Pieces = new Container<PathControlPointPiece> { RelativeSizeAxes = Axes.Both }
|
||||
};
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -62,19 +68,23 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
{
|
||||
foreach (var point in controlPoints)
|
||||
{
|
||||
var piece = new PathControlPointPiece(slider, point);
|
||||
Pieces.Add(new PathControlPointPiece(slider, point).With(d =>
|
||||
{
|
||||
if (allowSelection)
|
||||
d.RequestSelection = selectPiece;
|
||||
}));
|
||||
|
||||
if (allowSelection)
|
||||
piece.RequestSelection = selectPiece;
|
||||
|
||||
Pieces.Add(piece);
|
||||
connections.Add(new PathControlPointConnection(slider, point));
|
||||
}
|
||||
}
|
||||
|
||||
private void removeControlPoints(IEnumerable<PathControlPoint> controlPoints)
|
||||
{
|
||||
foreach (var point in controlPoints)
|
||||
{
|
||||
Pieces.RemoveAll(p => p.ControlPoint == point);
|
||||
connections.RemoveAll(c => c.ControlPoint == point);
|
||||
}
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
|
Reference in New Issue
Block a user