1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:47:27 +08:00

Implement binding to hitobjects + refreshing

This commit is contained in:
smoogipoo 2019-11-01 15:22:37 +09:00
parent c0badf1dce
commit e0ba35db75

View File

@ -283,6 +283,12 @@ namespace osu.Game.Rulesets.Osu.Tests
RelativeSizeAxes = Axes.Both;
}
protected override void LoadComplete()
{
base.LoadComplete();
bindHitObject(Start);
}
private DrawableOsuHitObject end;
/// <summary>
@ -295,10 +301,19 @@ namespace osu.Game.Rulesets.Osu.Tests
set
{
end = value;
bindHitObject(end);
refreshFollowPoints();
}
}
private void bindHitObject(DrawableOsuHitObject drawableObject)
{
drawableObject.HitObject.StartTimeBindable.BindValueChanged(_ => refreshFollowPoints());
drawableObject.HitObject.PositionBindable.BindValueChanged(_ => refreshFollowPoints());
drawableObject.HitObject.DefaultsApplied += refreshFollowPoints;
}
private void refreshFollowPoints()
{
ClearInternal();