1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04:07:25 +08:00

activate length change with context menu

This commit is contained in:
OliBomby 2024-06-19 23:15:35 +02:00
parent 82919998da
commit efc8e1431a
2 changed files with 12 additions and 2 deletions

View File

@ -20,6 +20,11 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
public partial class SliderTailPiece : SliderCircleOverlay
{
/// <summary>
/// Whether this slider tail is draggable, changing the distance of the slider.
/// </summary>
public bool IsDraggable { get; set; }
/// <summary>
/// Whether this is currently being dragged.
/// </summary>
@ -60,7 +65,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
Color4 colour = colours.Yellow;
if (IsHovered && inputManager.CurrentState.Keyboard.ShiftPressed
if (IsHovered && IsDraggable
&& !inputManager.HoveredDrawables.Any(o => o is PathControlPointPiece<Slider>))
colour = colour.Lighten(1);
@ -69,7 +74,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
protected override bool OnDragStart(DragStartEvent e)
{
if (e.Button == MouseButton.Right || !inputManager.CurrentState.Keyboard.ShiftPressed)
if (e.Button == MouseButton.Right || !IsDraggable)
return false;
isDragging = true;
@ -103,6 +108,7 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
trimExcessControlPoints(Slider.Path);
isDragging = false;
IsDraggable = false;
editorBeatmap?.EndChange();
}

View File

@ -409,6 +409,10 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders
addControlPoint(rightClickPosition);
changeHandler?.EndChange();
}),
new OsuMenuItem("Adjust distance", MenuItemType.Standard, () =>
{
TailPiece.IsDraggable = true;
}),
new OsuMenuItem("Convert to stream", MenuItemType.Destructive, convertToStream),
};