Allow placement deletion with middle mouse

This is in addition to Shift + Right-click.

I thik middle mouse feels more natural and is a good permanent solution
to this issue.

Note that this also *allows triggering the context menu from placement
mode*. Until now it's done nothing. This may be annoying to users with
muscle memory but I want to make the change and harvest feedback. I
think showing the context menu is more correct behaviour (although
arguably it should return to placement mode on dismiss?).
This commit is contained in:
Dean Herbert 2024-08-05 13:20:44 +09:00
parent 136cdcfb29
commit 0557b9ab79
No known key found for this signature in database
2 changed files with 2 additions and 4 deletions

View File

@ -209,9 +209,7 @@ namespace osu.Game.Rulesets.Edit
case MouseButtonEvent mouse:
// placement blueprints should generally block mouse from reaching underlying components (ie. performing clicks on interface buttons).
// for now, the one exception we want to allow is when using a non-main mouse button when shift is pressed, which is used to trigger object deletion
// while in placement mode.
return mouse.Button == MouseButton.Left || !mouse.ShiftPressed;
return mouse.Button == MouseButton.Left || PlacementActive == PlacementState.Active;
default:
return false;

View File

@ -263,7 +263,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <returns>Whether a selection was performed.</returns>
internal virtual bool MouseDownSelectionRequested(SelectionBlueprint<T> blueprint, MouseButtonEvent e)
{
if (e.ShiftPressed && e.Button == MouseButton.Right)
if (e.Button == MouseButton.Middle || (e.ShiftPressed && e.Button == MouseButton.Right))
{
handleQuickDeletion(blueprint);
return true;