mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Use bindables for hitobject events
This commit is contained in:
@ -1,14 +1,19 @@
|
||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Rulesets.Osu.Objects;
|
||||
using OpenTK;
|
||||
|
||||
namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
{
|
||||
public class PathControlPointVisualiser : CompositeDrawable
|
||||
{
|
||||
private readonly IBindable<Vector2[]> controlPointsBindable = new Bindable<Vector2[]>();
|
||||
|
||||
private readonly Slider slider;
|
||||
|
||||
private readonly Container<PathControlPointPiece> pieces;
|
||||
@ -18,9 +23,13 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
||||
this.slider = slider;
|
||||
|
||||
InternalChild = pieces = new Container<PathControlPointPiece> { RelativeSizeAxes = Axes.Both };
|
||||
}
|
||||
|
||||
slider.ControlPointsChanged += _ => updatePathControlPoints();
|
||||
updatePathControlPoints();
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
controlPointsBindable.BindValueChanged(_ => updatePathControlPoints());
|
||||
controlPointsBindable.BindTo(slider.ControlPointsBindable);
|
||||
}
|
||||
|
||||
private void updatePathControlPoints()
|
||||
|
Reference in New Issue
Block a user