private void load() { LayerBelowRuleset.AddRange(new Drawable[] { new PlayfieldBorder { RelativeSizeAxes = Axes.Both, PlayfieldBorderStyle = { Value = PlayfieldBorderStyle.Corners } }, distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both } }); selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy(); selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid(); placementObject = EditorBeatmap.PlacementObject.GetBoundCopy(); placementObject.ValueChanged += _ => updateDistanceSnapGrid(); distanceSnapToggle.ValueChanged += _ => updateDistanceSnapGrid(); // we may be entering the screen with a selection already active updateDistanceSnapGrid(); }
private void load() { LayerBelowRuleset.AddRange(new Drawable[] { new PlayfieldBorder { RelativeSizeAxes = Axes.Both, PlayfieldBorderStyle = { Value = PlayfieldBorderStyle.Corners } }, distanceSnapGridContainer = new Container { RelativeSizeAxes = Axes.Both }, rectangularPositionSnapGrid = new OsuRectangularPositionSnapGrid { RelativeSizeAxes = Axes.Both } }); selectedHitObjects = EditorBeatmap.SelectedHitObjects.GetBoundCopy(); selectedHitObjects.CollectionChanged += (_, __) => updateDistanceSnapGrid(); placementObject = EditorBeatmap.PlacementObject.GetBoundCopy(); placementObject.ValueChanged += _ => updateDistanceSnapGrid(); distanceSnapToggle.ValueChanged += _ => { updateDistanceSnapGrid(); if (distanceSnapToggle.Value == TernaryState.True) { rectangularGridSnapToggle.Value = TernaryState.False; } }; rectangularGridSnapToggle.ValueChanged += _ => { if (rectangularGridSnapToggle.Value == TernaryState.True) { distanceSnapToggle.Value = TernaryState.False; } }; // we may be entering the screen with a selection already active updateDistanceSnapGrid(); }