1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 11:42:54 +08:00

Refactor for legibility

This commit is contained in:
Dean Herbert 2024-05-05 23:32:24 +08:00
parent b1696db9c8
commit 9e7712740b
No known key found for this signature in database

View File

@ -23,13 +23,11 @@ namespace osu.Game.Graphics.UserInterface
protected override bool OnMouseDown(MouseDownEvent e)
{
if (!IsActionable)
return true;
// Right mouse button is a special case where we allow actioning without dismissing the menu.
// This is achieved by not calling `Clicked` (as done by the base implementation in OnClick).
if (IsActionable && e.Button == MouseButton.Right)
Item.Action.Value?.Invoke();
if (e.Button != MouseButton.Right)
return true;
Item.Action.Value?.Invoke();
return true;
}