From 97ea07db0e6ec5406f8b73cdc05618b8aad35793 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 8 Nov 2019 19:44:47 +0900 Subject: [PATCH] Add delete option to the right-click menu --- .../Edit/Compose/Components/SelectionHandler.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs b/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs index 7b61640c89..9b7082dec5 100644 --- a/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs +++ b/osu.Game/Screens/Edit/Compose/Components/SelectionHandler.cs @@ -80,8 +80,7 @@ public bool OnPressed(PlatformAction action) switch (action.ActionMethod) { case PlatformActionMethod.Delete: - foreach (var h in selectedBlueprints.ToList()) - placementHandler.Delete(h.DrawableObject.HitObject); + deleteSelected(); return true; } @@ -144,6 +143,12 @@ internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState UpdateVisibility(); } + private void deleteSelected() + { + foreach (var h in selectedBlueprints.ToList()) + placementHandler.Delete(h.DrawableObject.HitObject); + } + #endregion #region Outline Display @@ -234,7 +239,8 @@ public virtual MenuItem[] ContextMenuItems createHitSampleMenuItem("Clap", HitSampleInfo.HIT_CLAP), createHitSampleMenuItem("Finish", HitSampleInfo.HIT_FINISH) } - } + }, + new OsuMenuItem("Delete", MenuItemType.Destructive, deleteSelected), }; } }