mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 02:37:25 +09:00
Merge pull request #23660 from peppy/simplify-deselect
Fix crash when deleting dragged object in skin editor
This commit is contained in:
commit
b59f4aee99
@ -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;
|
||||||
}
|
}
|
||||||
@ -311,6 +311,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
protected void DeleteSelected()
|
protected void DeleteSelected()
|
||||||
{
|
{
|
||||||
DeleteItems(SelectedItems.ToArray());
|
DeleteItems(SelectedItems.ToArray());
|
||||||
|
DeselectAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user