Fix instant pausing when game becomes inactive

Resolves #4685.
This commit is contained in:
Dean Herbert
2019-04-30 21:52:49 +09:00
parent f05471aa18
commit b9a39fb788
2 changed files with 26 additions and 2 deletions

View File

@ -70,6 +70,11 @@ namespace osu.Game.Screens.Play.HUD
return base.OnMouseMove(e);
}
public bool GameInactive
{
set => button.GameInactive = value;
}
protected override void Update()
{
base.Update();
@ -184,6 +189,25 @@ namespace osu.Game.Screens.Play.HUD
base.OnHoverLost(e);
}
private bool gameInactive;
public bool GameInactive
{
get => gameInactive;
set
{
if (gameInactive == value)
return;
gameInactive = value;
if (gameInactive)
BeginConfirm();
else
AbortConfirm();
}
}
public bool OnPressed(GlobalAction action)
{
switch (action)