Add delete option to the right-click menu (#6770)

Add delete option to the right-click menu

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-11-12 18:00:08 +09:00 committed by GitHub
commit 9223a00396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -80,8 +80,7 @@ public bool OnPressed(PlatformAction action)
switch (action.ActionMethod) switch (action.ActionMethod)
{ {
case PlatformActionMethod.Delete: case PlatformActionMethod.Delete:
foreach (var h in selectedBlueprints.ToList()) deleteSelected();
placementHandler.Delete(h.DrawableObject.HitObject);
return true; return true;
} }
@ -144,6 +143,12 @@ internal void HandleSelectionRequested(SelectionBlueprint blueprint, InputState
UpdateVisibility(); UpdateVisibility();
} }
private void deleteSelected()
{
foreach (var h in selectedBlueprints.ToList())
placementHandler.Delete(h.DrawableObject.HitObject);
}
#endregion #endregion
#region Outline Display #region Outline Display
@ -234,7 +239,8 @@ public virtual MenuItem[] ContextMenuItems
createHitSampleMenuItem("Clap", HitSampleInfo.HIT_CLAP), createHitSampleMenuItem("Clap", HitSampleInfo.HIT_CLAP),
createHitSampleMenuItem("Finish", HitSampleInfo.HIT_FINISH) createHitSampleMenuItem("Finish", HitSampleInfo.HIT_FINISH)
} }
} },
new OsuMenuItem("Delete", MenuItemType.Destructive, deleteSelected),
}; };
} }
} }