mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 02:43:02 +08:00
Seek editor when hit objects are double clicked
This commit is contained in:
parent
813d3a0bfa
commit
3680e7c704
@ -11,6 +11,7 @@ using osu.Framework.Graphics.Containers;
|
|||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Edit.Tools;
|
using osu.Game.Rulesets.Edit.Tools;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@ -30,6 +31,9 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
private SelectionHandler selectionHandler;
|
private SelectionHandler selectionHandler;
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IAdjustableClock adjustableClock { get; set; }
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private HitObjectComposer composer { get; set; }
|
private HitObjectComposer composer { get; set; }
|
||||||
|
|
||||||
@ -106,6 +110,17 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
|||||||
return true;
|
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)
|
protected override bool OnMouseUp(MouseUpEvent e)
|
||||||
{
|
{
|
||||||
// Special case for when a drag happened instead of a click
|
// Special case for when a drag happened instead of a click
|
||||||
|
Loading…
Reference in New Issue
Block a user