mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 01:33:20 +08:00
Move model selection handling to base SelectionHandler
class
This commit is contained in:
parent
eac139ca0e
commit
32416e4e31
@ -37,22 +37,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
};
|
||||
}
|
||||
|
||||
internal override void HandleSelected(SelectionBlueprint<HitObject> blueprint)
|
||||
{
|
||||
base.HandleSelected(blueprint);
|
||||
|
||||
// there are potentially multiple SelectionHandlers active, but we only want to add hitobjects to the selected list once.
|
||||
if (!EditorBeatmap.SelectedHitObjects.Contains(blueprint.Item))
|
||||
EditorBeatmap.SelectedHitObjects.Add(blueprint.Item);
|
||||
}
|
||||
|
||||
internal override void HandleDeselected(SelectionBlueprint<HitObject> blueprint)
|
||||
{
|
||||
base.HandleDeselected(blueprint);
|
||||
|
||||
EditorBeatmap.SelectedHitObjects.Remove(blueprint.Item);
|
||||
}
|
||||
|
||||
protected override void DeleteItems(IEnumerable<HitObject> items) => EditorBeatmap.RemoveRange(items);
|
||||
|
||||
#region Selection State
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user