1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 10:12:54 +08:00

Simplify SelectionHandler's DeselectAll implementation

We are already doing other operations in this class directly on `SelectedItems`, so might as well change this one to match
This commit is contained in:
Dean Herbert 2023-05-25 18:46:31 +09:00
parent 59768c5ffd
commit 1049257b56
2 changed files with 3 additions and 4 deletions

View File

@ -92,7 +92,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
};
SelectionHandler = CreateSelectionHandler();
SelectionHandler.DeselectAll = DeselectAll;
SelectionHandler.SelectedItems.BindTo(SelectedItems);
AddRangeInternal(new[]

View File

@ -197,9 +197,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
#region Selection Handling
/// <summary>
/// Bind an action to deselect all selected blueprints.
/// Deselect all selected items.
/// </summary>
internal Action DeselectAll { private get; set; }
protected void DeselectAll() => SelectedItems.Clear();
/// <summary>
/// Handle a blueprint becoming selected.
@ -303,7 +303,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
if (blueprint.IsSelected)
return false;
DeselectAll?.Invoke();
DeselectAll();
blueprint.Select();
return true;
}