1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 21:02:55 +08:00

Make pause overlay close with pause gameplay action

This commit is contained in:
Joseph Madamba 2023-01-08 14:08:36 -08:00
parent 2803c98612
commit c2dd822e4a
2 changed files with 15 additions and 1 deletions

View File

@ -189,7 +189,7 @@ namespace osu.Game.Screens.Play
InternalButtons.Add(button);
}
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
public virtual bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (e.Action)
{

View File

@ -8,8 +8,10 @@ using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Graphics;
using osu.Framework.Input.Events;
using osu.Game.Audio;
using osu.Game.Graphics;
using osu.Game.Input.Bindings;
using osu.Game.Skinning;
using osuTK.Graphics;
@ -56,5 +58,17 @@ namespace osu.Game.Screens.Play
pauseLoop.VolumeTo(0, TRANSITION_DURATION, Easing.OutQuad).Finally(_ => pauseLoop.Stop());
}
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
{
switch (e.Action)
{
case GlobalAction.PauseGameplay:
BackAction.Invoke();
return true;
}
return base.OnPressed(e);
}
}
}