1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 08:22: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:
Dean Herbert 2019-11-06 19:22:41 +09:00 committed by GitHub
commit 70cf91fb40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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