mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
Split into a function
This commit is contained in:
parent
bb0f212448
commit
4c3789ec5d
@ -191,38 +191,44 @@ namespace osu.Game.Screens.Menu
|
||||
State = ButtonSystemState.Initial;
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
/// <summary>
|
||||
/// Triggers the <see cref="logo"/> if the current <see cref="State"/> is <see cref="ButtonSystemState.Initial"/>.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the <see cref="logo"/> was triggered, <c>false</c> otherwise.</returns>
|
||||
private bool triggerInitialOsuLogo()
|
||||
{
|
||||
if (e.Repeat || e.ControlPressed || e.ShiftPressed || e.AltPressed || e.SuperPressed)
|
||||
return false;
|
||||
|
||||
if (State == ButtonSystemState.Initial)
|
||||
{
|
||||
logo?.TriggerClick();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override bool OnKeyDown(KeyDownEvent e)
|
||||
{
|
||||
if (e.Repeat || e.ControlPressed || e.ShiftPressed || e.AltPressed || e.SuperPressed)
|
||||
return false;
|
||||
|
||||
if (triggerInitialOsuLogo())
|
||||
return true;
|
||||
|
||||
return base.OnKeyDown(e);
|
||||
}
|
||||
|
||||
protected override bool OnJoystickPress(JoystickPressEvent e)
|
||||
{
|
||||
if (State == ButtonSystemState.Initial)
|
||||
{
|
||||
logo?.TriggerClick();
|
||||
if (triggerInitialOsuLogo())
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnJoystickPress(e);
|
||||
}
|
||||
|
||||
protected override bool OnMidiDown(MidiDownEvent e)
|
||||
{
|
||||
if (State == ButtonSystemState.Initial)
|
||||
{
|
||||
logo?.TriggerClick();
|
||||
if (triggerInitialOsuLogo())
|
||||
return true;
|
||||
}
|
||||
|
||||
return base.OnMidiDown(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user