mirror of
https://github.com/osukey/osukey.git
synced 2025-05-05 21:57:24 +09:00
Simplify implementation
This commit is contained in:
parent
3680b9a380
commit
f77de7d880
@ -254,31 +254,19 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
{
|
{
|
||||||
Debug.Assert(!clickSelectionBegan);
|
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 blueprint in selectionBlueprints.AliveBlueprints)
|
||||||
foreach (SelectionBlueprint selected in selectionHandler.SelectedBlueprints)
|
|
||||||
{
|
{
|
||||||
if (selected.IsHovered)
|
if (blueprint.IsHovered)
|
||||||
{
|
{
|
||||||
hoveringSelected = true;
|
selectionHandler.HandleSelectionRequested(blueprint, e.CurrentState);
|
||||||
|
clickSelectionBegan = true;
|
||||||
break;
|
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>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user