mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Highlight timeline drag area when hovered for better visibility
This commit is contained in:
@ -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)
|
||||||
{
|
{
|
||||||
@ -38,7 +44,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
Height = 0.6f;
|
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);
|
||||||
|
Reference in New Issue
Block a user