Allow certain mouse input to pass through PlacementBlueprints to the selection logic

This commit is contained in:
Dean Herbert 2021-04-22 15:27:08 +09:00
parent cf1e3ea988
commit 9a7bf8109f

View File

@ -14,6 +14,7 @@ using osu.Game.Rulesets.Objects;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
using osu.Game.Screens.Edit.Compose; using osu.Game.Screens.Edit.Compose;
using osuTK; using osuTK;
using osuTK.Input;
namespace osu.Game.Rulesets.Edit namespace osu.Game.Rulesets.Edit
{ {
@ -128,8 +129,11 @@ namespace osu.Game.Rulesets.Edit
case DoubleClickEvent _: case DoubleClickEvent _:
return false; return false;
case MouseButtonEvent _: case MouseButtonEvent mouse:
return true; // 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;
default: default:
return false; return false;