1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 21:12:55 +08:00

Seek editor when hit objects are double clicked

This commit is contained in:
smoogipoo 2019-11-06 18:15:57 +09:00
parent 813d3a0bfa
commit 3680e7c704

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