From a012105dac4ca9af9f1d7d4548857eaba7c69892 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 10 Nov 2020 16:54:33 +0900 Subject: [PATCH] Fix editor quick delete being triggerable from left mouse button Closes https://github.com/ppy/osu/issues/10629. --- .../Edit/Compose/Components/BlueprintContainer.cs | 2 +- .../Edit/Compose/Components/SelectionHandler.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs b/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs index e7da220946..d5306c3450 100644 --- a/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs +++ b/osu.Game/Screens/Edit/Compose/Components/BlueprintContainer.cs @@ -303,7 +303,7 @@ namespace osu.Game.Screens.Edit.Compose.Components { if (blueprint.IsHovered) { - selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e.CurrentState); + selectedPerformed &= SelectionHandler.HandleSelectionRequested(blueprint, e); clickSelectionBegan = true; break; } diff --git a/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs b/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs index 0bbbfaf5e8..21810379cc 100644 --- a/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs +++ b/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs @@ -14,7 +14,7 @@ using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.UserInterface; using osu.Framework.Input; using osu.Framework.Input.Bindings; -using osu.Framework.Input.States; +using osu.Framework.Input.Events; using osu.Game.Audio; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; @@ -218,17 +218,17 @@ namespace osu.Game.Screens.Edit.Compose.Components /// Handle a blueprint requesting selection. /// /// The blueprint. - /// The input state at the point of selection. + /// The mouse event responsible for selection. /// Whether a selection was performed. - internal bool HandleSelectionRequested(SelectionBlueprint blueprint, InputState state) + internal bool HandleSelectionRequested(SelectionBlueprint blueprint, MouseButtonEvent e) { - if (state.Keyboard.ShiftPressed && state.Mouse.IsPressed(MouseButton.Right)) + if (e.ShiftPressed && e.Button == MouseButton.Right) { handleQuickDeletion(blueprint); return false; } - if (state.Keyboard.ControlPressed && state.Mouse.IsPressed(MouseButton.Left)) + if (e.ControlPressed && e.Button == MouseButton.Left) blueprint.ToggleSelection(); else ensureSelected(blueprint);