Exemple #1
0
        /// <summary>
        /// Handle a blueprint requesting selection.
        /// </summary>
        /// <param name="blueprint">The blueprint.</param>
        internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState state)
        {
            if (state.Keyboard.ControlPressed)
            {
                if (blueprint.IsSelected)
                {
                    blueprint.Deselect();
                }
                else
                {
                    blueprint.Select();
                }
            }
            else
            {
                if (blueprint.IsSelected)
                {
                    return;
                }

                DeselectAll?.Invoke();
                blueprint.Select();
            }

            UpdateVisibility();
        }
Exemple #2
0
        private void load()
        {
            base.Content.Add(blueprint    = CreateBlueprint());
            blueprint.SelectionRequested += (_, __) => blueprint.Select();

            AddStep("Select", () => blueprint.Select());
            AddStep("Deselect", () => blueprint.Deselect());
        }
        private void load()
        {
            blueprint       = CreateBlueprint();
            blueprint.Depth = float.MinValue;
            blueprint.SelectionRequested += (_, __) => blueprint.Select();

            Add(blueprint);

            AddStep("Select", () => blueprint.Select());
            AddStep("Deselect", () => blueprint.Deselect());
        }
 protected override bool OnClick(ClickEvent e)
 {
     blueprint.Deselect();
     return(true);
 }