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 = CreateSelectionHandler();
|
||||||
SelectionHandler.DeselectAll = DeselectAll;
|
|
||||||
SelectionHandler.SelectedItems.BindTo(SelectedItems);
|
SelectionHandler.SelectedItems.BindTo(SelectedItems);
|
||||||
|
|
||||||
AddRangeInternal(new[]
|
AddRangeInternal(new[]
|
||||||
|
@ -197,9 +197,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
#region Selection Handling
|
#region Selection Handling
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Bind an action to deselect all selected blueprints.
|
/// Deselect all selected items.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal Action DeselectAll { private get; set; }
|
protected void DeselectAll() => SelectedItems.Clear();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handle a blueprint becoming selected.
|
/// Handle a blueprint becoming selected.
|
||||||
@ -303,7 +303,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
if (blueprint.IsSelected)
|
if (blueprint.IsSelected)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DeselectAll?.Invoke();
|
DeselectAll();
|
||||||
blueprint.Select();
|
blueprint.Select();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user