mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 10:17:19 +08:00
Merge pull request #11238 from peppy/editor-timeline-selection-ux
Improve drag and selection UX on editor timeline
This commit is contained in:
commit
9de42f8646
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Primitives;
|
|||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
using osu.Game.Screens.Edit.Components.Timelines.Summary.Parts;
|
||||||
@ -25,10 +26,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private EditorBeatmap beatmap { get; set; }
|
private EditorBeatmap beatmap { get; set; }
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
private DragEvent lastDragEvent;
|
private DragEvent lastDragEvent;
|
||||||
private Bindable<HitObject> placement;
|
private Bindable<HitObject> placement;
|
||||||
private SelectionBlueprint placementBlueprint;
|
private SelectionBlueprint placementBlueprint;
|
||||||
|
|
||||||
|
private readonly Box backgroundBox;
|
||||||
|
|
||||||
public TimelineBlueprintContainer(HitObjectComposer composer)
|
public TimelineBlueprintContainer(HitObjectComposer composer)
|
||||||
: base(composer)
|
: base(composer)
|
||||||
{
|
{
|
||||||
@ -36,9 +42,9 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Height = 0.4f;
|
Height = 0.6f;
|
||||||
|
|
||||||
AddInternal(new Box
|
AddInternal(backgroundBox = new Box
|
||||||
{
|
{
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
@ -77,6 +83,18 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
protected override Container<SelectionBlueprint> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };
|
protected override Container<SelectionBlueprint> CreateSelectionBlueprintContainer() => new TimelineSelectionBlueprintContainer { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
backgroundBox.FadeColour(colours.BlueLighter, 120, Easing.OutQuint);
|
||||||
|
return base.OnHover(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
|
{
|
||||||
|
backgroundBox.FadeColour(Color4.Black, 600, Easing.OutQuint);
|
||||||
|
base.OnHoverLost(e);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnDrag(DragEvent e)
|
protected override void OnDrag(DragEvent e)
|
||||||
{
|
{
|
||||||
handleScrollViaDrag(e);
|
handleScrollViaDrag(e);
|
||||||
|
@ -29,7 +29,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
{
|
{
|
||||||
private const float thickness = 5;
|
private const float thickness = 5;
|
||||||
private const float shadow_radius = 5;
|
private const float shadow_radius = 5;
|
||||||
private const float circle_size = 24;
|
private const float circle_size = 34;
|
||||||
|
|
||||||
public Action<DragEvent> OnDragHandled;
|
public Action<DragEvent> OnDragHandled;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user