Simplify implementation

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

View File

@ -254,21 +254,10 @@ 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)
{
if (selected.IsHovered)
{
hoveringSelected = true;
break;
}
}
// Attempt a new selection at the mouse position
if (!hoveringSelected)
{
foreach (SelectionBlueprint blueprint in selectionBlueprints.AliveBlueprints)
{
if (blueprint.IsHovered)
@ -279,7 +268,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
}
}
}
}
/// <summary>
/// Finishes the current blueprint selection.