mirror of https://github.com/ppy/osu
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 @@ private void load(OsuColour colours)
|
|||
|
||||
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 @@ protected override void OnMouseUp(MouseUpEvent e)
|
|||
rewindSearch = true;
|
||||
TriggerClick();
|
||||
}
|
||||
|
||||
updateText(e);
|
||||
}
|
||||
|
||||
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
|
@ -150,10 +158,12 @@ public override void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
|
|||
}
|
||||
}
|
||||
|
||||
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