mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Merge pull request #12308 from peppy/editor-timeline-select-intro-blueprints
Fix not being able to select timeline blueprints in intro time
This commit is contained in:
@ -9,6 +9,7 @@ using osu.Framework.Extensions.Color4Extensions;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Audio;
|
using osu.Framework.Graphics.Audio;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
@ -91,6 +92,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
},
|
},
|
||||||
ticks = new TimelineTickDisplay(),
|
ticks = new TimelineTickDisplay(),
|
||||||
controlPoints = new TimelineControlPointDisplay(),
|
controlPoints = new TimelineControlPointDisplay(),
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Name = "zero marker",
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 2,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Colour = colours.YellowDarker,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -6,7 +6,9 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
@ -16,6 +18,7 @@ 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;
|
||||||
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
||||||
@ -35,7 +38,15 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
private Bindable<HitObject> placement;
|
private Bindable<HitObject> placement;
|
||||||
private SelectionBlueprint placementBlueprint;
|
private SelectionBlueprint placementBlueprint;
|
||||||
|
|
||||||
private readonly Box backgroundBox;
|
private SelectableAreaBackground backgroundBox;
|
||||||
|
|
||||||
|
// we only care about checking vertical validity.
|
||||||
|
// this allows selecting and dragging selections before time=0.
|
||||||
|
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos)
|
||||||
|
{
|
||||||
|
float localY = ToLocalSpace(screenSpacePos).Y;
|
||||||
|
return DrawRectangle.Top <= localY && DrawRectangle.Bottom >= localY;
|
||||||
|
}
|
||||||
|
|
||||||
public TimelineBlueprintContainer(HitObjectComposer composer)
|
public TimelineBlueprintContainer(HitObjectComposer composer)
|
||||||
: base(composer)
|
: base(composer)
|
||||||
@ -45,12 +56,14 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Height = 0.6f;
|
Height = 0.6f;
|
||||||
|
}
|
||||||
|
|
||||||
AddInternal(backgroundBox = new Box
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
AddInternal(backgroundBox = new SelectableAreaBackground
|
||||||
{
|
{
|
||||||
Colour = Color4.Black,
|
Colour = Color4.Black
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Alpha = 0.1f,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +208,33 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class SelectableAreaBackground : CompositeDrawable
|
||||||
|
{
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
Alpha = 0.1f;
|
||||||
|
|
||||||
|
AddRangeInternal(new[]
|
||||||
|
{
|
||||||
|
// fade out over intro time, outside the valid time bounds.
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Width = 200,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Colour = ColourInfo.GradientHorizontal(Color4.White.Opacity(0), Color4.White),
|
||||||
|
},
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = Color4.White,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal class TimelineSelectionHandler : SelectionHandler
|
internal class TimelineSelectionHandler : SelectionHandler
|
||||||
{
|
{
|
||||||
// for now we always allow movement. snapping is provided by the Timeline's "distance" snap implementation
|
// for now we always allow movement. snapping is provided by the Timeline's "distance" snap implementation
|
||||||
|
Reference in New Issue
Block a user