mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Show "rewind" text on random button when beginning a right mouse press
This commit is contained in:
parent
94b184712d
commit
764f0323f4
@ -93,16 +93,22 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
{
|
||||
updateText(e.ShiftPressed);
|
||||
updateText(e);
|
||||
return base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
protected override void OnKeyUp(KeyUpEvent e)
|
||||
{
|
||||
updateText(e.ShiftPressed);
|
||||
updateText(e);
|
||||
base.OnKeyUp(e);
|
||||
}
|
||||
|
||||
protected override bool OnMouseDown(MouseDownEvent e)
|
||||
{
|
||||
updateText(e);
|
||||
return base.OnMouseDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
try
|
||||
@ -126,6 +132,8 @@ namespace osu.Game.Screens.Select
|
||||
rewindSearch = true;
|
||||
TriggerClick();
|
||||
}
|
||||
|
||||
updateText(e);
|
||||
}
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
@ -150,10 +158,12 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
}
|
||||
|
||||
private void updateText(bool rewind = false)
|
||||
private void updateText(UIEvent e)
|
||||
{
|
||||
randomSpriteText.Alpha = rewind ? 0 : 1;
|
||||
rewindSpriteText.Alpha = rewind ? 1 : 0;
|
||||
bool aboutToRewind = e.ShiftPressed || e.CurrentState.Mouse.IsPressed(MouseButton.Right);
|
||||
|
||||
randomSpriteText.Alpha = aboutToRewind ? 0 : 1;
|
||||
rewindSpriteText.Alpha = aboutToRewind ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user