mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Disallow deselections with right clicks
This commit is contained in:
@ -313,14 +313,15 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
/// Attempts to select any hovered blueprints.
|
/// Attempts to select any hovered blueprints.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="e">The input event that triggered this selection.</param>
|
/// <param name="e">The input event that triggered this selection.</param>
|
||||||
private void beginClickSelection(UIEvent e)
|
private void beginClickSelection(MouseButtonEvent e)
|
||||||
{
|
{
|
||||||
Debug.Assert(!clickSelectionBegan);
|
Debug.Assert(!clickSelectionBegan);
|
||||||
|
|
||||||
// If a select blueprint is already hovered, disallow changes in selection.
|
// Deselections are only allowed for control + left clicks
|
||||||
// Exception is made when holding control, as deselection should still be allowed.
|
bool allowDeselection = e.ControlPressed && e.Button == MouseButton.Left;
|
||||||
if (!e.CurrentState.Keyboard.ControlPressed &&
|
|
||||||
selectionHandler.SelectedBlueprints.Any(s => s.IsHovered))
|
// Todo: This is probably incorrectly disallowing multiple selections on stacked objects
|
||||||
|
if (!allowDeselection && selectionHandler.SelectedBlueprints.Any(s => s.IsHovered))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
foreach (SelectionBlueprint blueprint in selectionBlueprints.AliveBlueprints)
|
foreach (SelectionBlueprint blueprint in selectionBlueprints.AliveBlueprints)
|
||||||
|
Reference in New Issue
Block a user