1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 02:02:53 +08:00

Simplify implementation

This commit is contained in:
Dean Herbert 2019-11-05 18:25:38 +09:00
parent 3680b9a380
commit f77de7d880

View File

@ -254,31 +254,19 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
Debug.Assert(!clickSelectionBegan);
bool hoveringSelected = false;
// If a select blueprint is already hovered, disallow changes in selection.
if (selectionHandler.SelectedBlueprints.Any(s => s.IsHovered))
return;
// Make sure any already-selected blueprints aren't being hovered over
foreach (SelectionBlueprint selected in selectionHandler.SelectedBlueprints)
foreach (SelectionBlueprint blueprint in selectionBlueprints.AliveBlueprints)
{
if (selected.IsHovered)
if (blueprint.IsHovered)
{
hoveringSelected = true;
selectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
clickSelectionBegan = true;
break;
}
}
// Attempt a new selection at the mouse position
if (!hoveringSelected)
{
foreach (SelectionBlueprint blueprint in selectionBlueprints.AliveBlueprints)
{
if (blueprint.IsHovered)
{
selectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
clickSelectionBegan = true;
break;
}
}
}
}
/// <summary>