mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 02:33:02 +08:00
Merge pull request #10199 from peppy/fix-editor-binding-crash
Fix bindings not correctly being cleaned up in OsuHitObjectComposer
This commit is contained in:
commit
625c146460
@ -46,13 +46,20 @@ namespace osu.Game.Rulesets.Osu.Edit
|
|||||||
distanceSnapToggle
|
distanceSnapToggle
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private BindableList<HitObject> selectedHitObjects;
|
||||||
|
|
||||||
|
private Bindable<HitObject> placementObject;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
LayerBelowRuleset.Add(distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both });
|
LayerBelowRuleset.Add(distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both });
|
||||||
|
|
||||||
EditorBeatmap.SelectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid();
|
selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy();
|
||||||
EditorBeatmap.PlacementObject.ValueChanged += _ => updateDistanceSnapGrid();
|
selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid();
|
||||||
|
|
||||||
|
placementObject = EditorBeatmap.PlacementObject.GetBoundCopy();
|
||||||
|
placementObject.ValueChanged += _ => updateDistanceSnapGrid();
|
||||||
distanceSnapToggle.ValueChanged += _ => updateDistanceSnapGrid();
|
distanceSnapToggle.ValueChanged += _ => updateDistanceSnapGrid();
|
||||||
|
|
||||||
// we may be entering the screen with a selection already active
|
// we may be entering the screen with a selection already active
|
||||||
|
Loading…
Reference in New Issue
Block a user