mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +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:
parent
59768c5ffd
commit
1049257b56
@ -92,7 +92,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
};
|
||||
|
||||
SelectionHandler = CreateSelectionHandler();
|
||||
SelectionHandler.DeselectAll = DeselectAll;
|
||||
SelectionHandler.SelectedItems.BindTo(SelectedItems);
|
||||
|
||||
AddRangeInternal(new[]
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user