mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 11:33:22 +08:00
End circle only gets brighter once shift is held
This commit is contained in:
parent
2261d65b01
commit
203e9284eb
@ -61,11 +61,38 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
|
|||||||
updateCirclePieceColour();
|
updateCirclePieceColour();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnKeyDown(KeyDownEvent e)
|
||||||
|
{
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
handleDragToggle(e);
|
||||||
|
return base.OnKeyDown(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnKeyUp(KeyUpEvent e)
|
||||||
|
{
|
||||||
|
handleDragToggle(e);
|
||||||
|
base.OnKeyUp(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool lastShiftPressed;
|
||||||
|
|
||||||
|
private void handleDragToggle(KeyboardEvent key)
|
||||||
|
{
|
||||||
|
bool shiftPressed = key.ShiftPressed;
|
||||||
|
|
||||||
|
if (shiftPressed == lastShiftPressed) return;
|
||||||
|
|
||||||
|
lastShiftPressed = shiftPressed;
|
||||||
|
updateCirclePieceColour();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateCirclePieceColour()
|
private void updateCirclePieceColour()
|
||||||
{
|
{
|
||||||
Color4 colour = colours.Yellow;
|
Color4 colour = colours.Yellow;
|
||||||
|
|
||||||
if (IsHovered)
|
if (IsHovered && inputManager.CurrentState.Keyboard.ShiftPressed)
|
||||||
colour = colour.Lighten(1);
|
colour = colour.Lighten(1);
|
||||||
|
|
||||||
CirclePiece.Colour = colour;
|
CirclePiece.Colour = colour;
|
||||||
|
Loading…
Reference in New Issue
Block a user