Пример #1
0
        protected override void OnDragEnd(DragEndEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (isDraggingBlueprint)
            {
                // handle positional change etc.
                foreach (var obj in selectedHitObjects)
                {
                    Beatmap.Update(obj);
                }

                changeHandler?.EndChange();
                isDraggingBlueprint = false;
            }

            if (DragBox.State == Visibility.Visible)
            {
                DragBox.Hide();
                SelectionHandler.UpdateVisibility();
            }
        }
Пример #2
0
        private void load()
        {
            selectionBox             = composer.CreateSelectionBox();
            selectionBox.DeselectAll = deselectAll;

            var dragBox = new DragBox(select);

            dragBox.DragEnd += () => selectionBox.UpdateVisibility();

            InternalChildren = new[]
            {
                dragBox,
                selectionBox,
                selectionBlueprints = new SelectionBlueprintContainer {
                    RelativeSizeAxes = Axes.Both
                },
                placementBlueprintContainer = new Container <PlacementBlueprint> {
                    RelativeSizeAxes = Axes.Both
                },
                dragBox.CreateProxy()
            };

            foreach (var obj in composer.HitObjects)
            {
                AddBlueprintFor(obj);
            }
        }
Пример #3
0
        protected override void OnDrag(DragEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (!moveCurrentSelection(e))
            {
                DragBox.UpdateDrag(e);
            }
        }
Пример #4
0
        protected override void OnDragEnd(DragEndEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (!finishSelectionMovement())
            {
                DragBox.FadeOut(250, Easing.OutQuint);
                selectionHandler.UpdateVisibility();
            }
        }
Пример #5
0
        protected override void OnDragEnd(DragEndEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (DragBox.State == Visibility.Visible)
            {
                DragBox.Hide();
                selectionHandler.UpdateVisibility();
            }
        }
Пример #6
0
        protected override void OnDrag(DragEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (DragBox.State == Visibility.Visible)
            {
                DragBox.HandleDrag(e);
            }

            moveCurrentSelection(e);
        }
Пример #7
0
        private void load()
        {
            SelectionHandler             = CreateSelectionHandler();
            SelectionHandler.DeselectAll = deselectAll;

            AddRangeInternal(new[]
            {
                DragBox = CreateDragBox(selectBlueprintsFromDragRectangle),
                SelectionHandler,
                SelectionBlueprints = CreateSelectionBlueprintContainer(),
                SelectionHandler.CreateProxy(),
                DragBox.CreateProxy().With(p => p.Depth = float.MinValue)
            });
        }
Пример #8
0
        private void load()
        {
            SelectionHandler             = CreateSelectionHandler();
            SelectionHandler.DeselectAll = deselectAll;

            AddRangeInternal(new[]
            {
                DragBox = CreateDragBox(selectBlueprintsFromDragRectangle),
                SelectionHandler,
                SelectionBlueprints = CreateSelectionBlueprintContainer(),
                SelectionHandler.CreateProxy(),
                DragBox.CreateProxy().With(p => p.Depth = float.MinValue)
            });

            // For non-pooled rulesets, hitobjects are already present in the playfield which allows the blueprints to be loaded in the async context.
            if (Composer != null)
            {
                foreach (var obj in Composer.HitObjects)
                {
                    addBlueprintFor(obj.HitObject);
                }
            }

            selectedHitObjects.BindTo(Beatmap.SelectedHitObjects);
            selectedHitObjects.CollectionChanged += (selectedObjects, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (var o in args.NewItems)
                    {
                        SelectionBlueprints.FirstOrDefault(b => b.HitObject == o)?.Select();
                    }
                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (var o in args.OldItems)
                    {
                        SelectionBlueprints.FirstOrDefault(b => b.HitObject == o)?.Deselect();
                    }

                    break;
                }
            };
        }
Пример #9
0
        protected override void OnDragEnd(DragEndEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (isDraggingBlueprint)
            {
                DragOperationCompleted();
                changeHandler?.EndChange();
            }

            if (DragBox.State == Visibility.Visible)
            {
                DragBox.Hide();
            }
        }
Пример #10
0
        protected override bool OnDragStart(DragStartEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return(false);
            }

            if (!beginSelectionMovement())
            {
                if (!DragBox.UpdateDrag(e))
                {
                    return(false);
                }

                DragBox.FadeIn(250, Easing.OutQuint);
            }

            return(true);
        }
Пример #11
0
        protected override void OnDragEnd(DragEndEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return;
            }

            if (isDraggingBlueprint)
            {
                changeHandler?.EndChange();
                isDraggingBlueprint = false;
            }

            if (DragBox.State == Visibility.Visible)
            {
                DragBox.Hide();
                selectionHandler.UpdateVisibility();
            }
        }
Пример #12
0
        protected override bool OnDragStart(DragStartEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return(false);
            }

            if (movementBlueprint != null)
            {
                return(true);
            }

            if (DragBox.HandleDrag(e))
            {
                DragBox.Show();
                return(true);
            }

            return(false);
        }
Пример #13
0
        private void load()
        {
            selectionHandler             = CreateSelectionHandler();
            selectionHandler.DeselectAll = deselectAll;

            AddRangeInternal(new[]
            {
                DragBox = CreateDragBox(select),
                selectionHandler,
                selectionBlueprints = new SelectionBlueprintContainer {
                    RelativeSizeAxes = Axes.Both
                },
                DragBox.CreateProxy().With(p => p.Depth = float.MinValue)
            });

            foreach (var obj in beatmap.HitObjects)
            {
                AddBlueprintFor(obj);
            }
        }
Пример #14
0
        private void load()
        {
            SelectionHandler             = CreateSelectionHandler();
            SelectionHandler.DeselectAll = deselectAll;

            AddRangeInternal(new[]
            {
                DragBox = CreateDragBox(selectBlueprintsFromDragRectangle),
                SelectionHandler,
                SelectionBlueprints = CreateSelectionBlueprintContainer(),
                SelectionHandler.CreateProxy(),
                DragBox.CreateProxy().With(p => p.Depth = float.MinValue)
            });

            foreach (var obj in Beatmap.HitObjects)
            {
                AddBlueprintFor(obj);
            }

            selectedHitObjects.BindTo(Beatmap.SelectedHitObjects);
            selectedHitObjects.CollectionChanged += (selectedObjects, args) =>
            {
                switch (args.Action)
                {
                case NotifyCollectionChangedAction.Add:
                    foreach (var o in args.NewItems)
                    {
                        SelectionBlueprints.FirstOrDefault(b => b.HitObject == o)?.Select();
                    }
                    break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (var o in args.OldItems)
                    {
                        SelectionBlueprints.FirstOrDefault(b => b.HitObject == o)?.Deselect();
                    }

                    break;
                }
            };
        }
Пример #15
0
        protected override bool OnDragStart(DragStartEvent e)
        {
            if (e.Button == MouseButton.Right)
            {
                return(false);
            }

            if (movementBlueprints != null)
            {
                isDraggingBlueprint = true;
                changeHandler?.BeginChange();
                return(true);
            }

            if (DragBox.HandleDrag(e))
            {
                DragBox.Show();
                return(true);
            }

            return(false);
        }
Пример #16
0
        private void load()
        {
            selectionHandler             = CreateSelectionHandler();
            selectionHandler.DeselectAll = deselectAll;

            AddRangeInternal(new[]
            {
                DragBox = CreateDragBox(select),
                selectionHandler,
                selectionBlueprints = CreateSelectionBlueprintContainer(),
                DragBox.CreateProxy().With(p => p.Depth = float.MinValue)
            });

            foreach (var obj in beatmap.HitObjects)
            {
                AddBlueprintFor(obj);
            }

            selectedHitObjects.BindTo(beatmap.SelectedHitObjects);
            selectedHitObjects.ItemsAdded += objects =>
            {
                foreach (var o in objects)
                {
                    selectionBlueprints.FirstOrDefault(b => b.HitObject == o)?.Select();
                }

                SelectionChanged?.Invoke(selectedHitObjects);
            };

            selectedHitObjects.ItemsRemoved += objects =>
            {
                foreach (var o in objects)
                {
                    selectionBlueprints.FirstOrDefault(b => b.HitObject == o)?.Deselect();
                }

                SelectionChanged?.Invoke(selectedHitObjects);
            };
        }
Пример #17
0
        private void load()
        {
            selectionHandler             = composer.CreateSelectionHandler();
            selectionHandler.DeselectAll = deselectAll;

            InternalChildren = new[]
            {
                dragBox = new DragBox(select),
                selectionHandler,
                selectionBlueprints = new SelectionBlueprintContainer {
                    RelativeSizeAxes = Axes.Both
                },
                placementBlueprintContainer = new Container <PlacementBlueprint> {
                    RelativeSizeAxes = Axes.Both
                },
                dragBox.CreateProxy()
            };

            foreach (var obj in composer.HitObjects)
            {
                addBlueprintFor(obj);
            }
        }