mirror of
https://github.com/ppy/osu
synced 2025-02-19 20:06:53 +00:00
Merge pull request #19005 from Susko3/initial-cookie
Allow MIDI and joysticks to trigger the osu! cookie on the initial screen
This commit is contained in:
commit
85e589f863
@ -191,20 +191,48 @@ 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 (triggerInitialOsuLogo())
|
||||
return true;
|
||||
|
||||
return base.OnJoystickPress(e);
|
||||
}
|
||||
|
||||
protected override bool OnMidiDown(MidiDownEvent e)
|
||||
{
|
||||
if (triggerInitialOsuLogo())
|
||||
return true;
|
||||
|
||||
return base.OnMidiDown(e);
|
||||
}
|
||||
|
||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
if (e.Repeat)
|
||||
|
Loading…
Reference in New Issue
Block a user