Move model selection handling to base SelectionHandler class

This commit is contained in:
Dean Herbert
2021-04-27 17:42:10 +09:00
parent eac139ca0e
commit 32416e4e31
2 changed files with 5 additions and 16 deletions

View File

@ -196,6 +196,10 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
internal virtual void HandleSelected(SelectionBlueprint<T> blueprint)
{
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
if (!SelectedItems.Contains(blueprint.Item))
SelectedItems.Add(blueprint.Item);
selectedBlueprints.Add(blueprint);
}
@ -205,6 +209,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
/// <param name="blueprint">The blueprint.</param>
internal virtual void HandleDeselected(SelectionBlueprint<T> blueprint)
{
SelectedItems.Remove(blueprint.Item);
selectedBlueprints.Remove(blueprint);
}