mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 18:42:56 +08:00
Seek editor when hit objects are double clicked (#6745)
Seek editor when hit objects are double clicked
This commit is contained in:
commit
70cf91fb40
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Primitives;
|
||||
using osu.Framework.Input;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Rulesets.Edit;
|
||||
using osu.Game.Rulesets.Edit.Tools;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
@ -30,6 +31,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
private SelectionHandler selectionHandler;
|
||||
private InputManager inputManager;
|
||||
|
||||
[Resolved]
|
||||
private IAdjustableClock adjustableClock { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private HitObjectComposer composer { get; set; }
|
||||
|
||||
@ -106,6 +110,17 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool OnDoubleClick(DoubleClickEvent e)
|
||||
{
|
||||
SelectionBlueprint clickedBlueprint = selectionHandler.SelectedBlueprints.FirstOrDefault(b => b.IsHovered);
|
||||
|
||||
if (clickedBlueprint == null)
|
||||
return false;
|
||||
|
||||
adjustableClock?.Seek(clickedBlueprint.DrawableObject.HitObject.StartTime);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override bool OnMouseUp(MouseUpEvent e)
|
||||
{
|
||||
// Special case for when a drag happened instead of a click
|
||||
|
Loading…
Reference in New Issue
Block a user