mirror of
https://github.com/ppy/osu.git
synced 2025-01-19 02:52:54 +08:00
Unify juice stream piece UX with osu! control point pieces
- Use same hover state - Use shift-right click for quick delete rather than shift-left click
This commit is contained in:
parent
47964f33d7
commit
6b3c1f4e47
@ -52,7 +52,7 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
|
|||||||
if (index == -1 || VertexStates[index].IsFixed)
|
if (index == -1 || VertexStates[index].IsFixed)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (e.Button == MouseButton.Left && e.ShiftPressed)
|
if (e.Button == MouseButton.Right && e.ShiftPressed)
|
||||||
{
|
{
|
||||||
changeHandler?.BeginChange();
|
changeHandler?.BeginChange();
|
||||||
RemoveVertex(index);
|
RemoveVertex(index);
|
||||||
|
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
|||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
@ -12,6 +13,8 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
|
|||||||
{
|
{
|
||||||
public partial class VertexPiece : Circle
|
public partial class VertexPiece : Circle
|
||||||
{
|
{
|
||||||
|
private VertexState state = new VertexState();
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private OsuColour osuColour { get; set; } = null!;
|
private OsuColour osuColour { get; set; } = null!;
|
||||||
|
|
||||||
@ -24,7 +27,32 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
|
|||||||
|
|
||||||
public void UpdateFrom(VertexState state)
|
public void UpdateFrom(VertexState state)
|
||||||
{
|
{
|
||||||
Colour = state.IsSelected ? osuColour.Yellow.Lighten(1) : osuColour.Yellow;
|
this.state = state;
|
||||||
|
updateMarkerDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
updateMarkerDisplay();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
|
{
|
||||||
|
updateMarkerDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Updates the state of the circular control point marker.
|
||||||
|
/// </summary>
|
||||||
|
private void updateMarkerDisplay()
|
||||||
|
{
|
||||||
|
var colour = osuColour.Yellow;
|
||||||
|
|
||||||
|
if (IsHovered || state.IsSelected)
|
||||||
|
colour = colour.Lighten(1);
|
||||||
|
|
||||||
|
Colour = colour;
|
||||||
Alpha = state.IsFixed ? 0.5f : 1;
|
Alpha = state.IsFixed ? 0.5f : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user