mirror of
https://github.com/ppy/osu
synced 2025-01-25 15:23:02 +00:00
Fix items without blueprints are not deselected
This commit is contained in:
parent
2a7476cc4a
commit
0d448e6cc8
@ -77,7 +77,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
};
|
||||
|
||||
SelectionHandler = CreateSelectionHandler();
|
||||
SelectionHandler.DeselectAll = deselectAll;
|
||||
SelectionHandler.DeselectAll = DeselectAll;
|
||||
SelectionHandler.SelectedItems.BindTo(SelectedItems);
|
||||
|
||||
AddRangeInternal(new[]
|
||||
@ -145,7 +145,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
if (endClickSelection(e) || ClickedBlueprint != null)
|
||||
return true;
|
||||
|
||||
deselectAll();
|
||||
DeselectAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
if (!SelectionHandler.SelectedBlueprints.Any())
|
||||
return false;
|
||||
|
||||
deselectAll();
|
||||
DeselectAll();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -399,18 +399,14 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selects all <see cref="SelectionBlueprint{T}"/>s.
|
||||
/// Select all currently-present items.
|
||||
/// </summary>
|
||||
protected virtual void SelectAll()
|
||||
{
|
||||
// Scheduled to allow the change in lifetime to take place.
|
||||
Schedule(() => SelectionBlueprints.ToList().ForEach(m => m.Select()));
|
||||
}
|
||||
protected abstract void SelectAll();
|
||||
|
||||
/// <summary>
|
||||
/// Deselects all selected <see cref="SelectionBlueprint{T}"/>s.
|
||||
/// Deselect all selected items.
|
||||
/// </summary>
|
||||
private void deselectAll() => SelectionHandler.SelectedBlueprints.ToList().ForEach(m => m.Deselect());
|
||||
protected void DeselectAll() => SelectedItems.Clear();
|
||||
|
||||
protected virtual void OnBlueprintSelected(SelectionBlueprint<T> blueprint)
|
||||
{
|
||||
|
@ -131,8 +131,8 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
protected override void SelectAll()
|
||||
{
|
||||
Composer.Playfield.KeepAllAlive();
|
||||
|
||||
base.SelectAll();
|
||||
SelectedItems.Clear();
|
||||
SelectedItems.AddRange(Beatmap.HitObjects);
|
||||
}
|
||||
|
||||
protected override void OnBlueprintSelected(SelectionBlueprint<HitObject> blueprint)
|
||||
|
@ -117,6 +117,12 @@ namespace osu.Game.Skinning.Editor
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void SelectAll()
|
||||
{
|
||||
SelectedItems.Clear();
|
||||
SelectedItems.AddRange(targetComponents.SelectMany(list => list));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Move the current selection spatially by the specified delta, in screen coordinates (ie. the same coordinates as the blueprints).
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user