1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Fix bindings not correctly being cleaned up in OsuHitObjectComposer

This commit is contained in:
Dean Herbert 2020-09-21 18:15:33 +09:00
parent 896aa7f3ea
commit 842f8bea55

View File

@ -46,13 +46,20 @@ namespace osu.Game.Rulesets.Osu.Edit
distanceSnapToggle
};
private BindableList<HitObject> selectedHitObjects;
private Bindable<HitObject> placementObject;
[BackgroundDependencyLoader]
private void load()
{
LayerBelowRuleset.Add(distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both });
EditorBeatmap.SelectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid();
EditorBeatmap.PlacementObject.ValueChanged += _ => updateDistanceSnapGrid();
selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy();
selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid();
placementObject = EditorBeatmap.PlacementObject.GetBoundCopy();
placementObject.ValueChanged += _ => updateDistanceSnapGrid();
distanceSnapToggle.ValueChanged += _ => updateDistanceSnapGrid();
}