mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 13:42:59 +08:00
parent
f05471aa18
commit
b9a39fb788
@ -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)
|
||||
|
@ -393,8 +393,8 @@ namespace osu.Game.Screens.Play
|
||||
base.Update();
|
||||
|
||||
// eagerly pause when we lose window focus (if we are locally playing).
|
||||
if (PauseOnFocusLost && !Game.IsActive.Value)
|
||||
Pause();
|
||||
if (PauseOnFocusLost)
|
||||
HUDOverlay.HoldToQuit.GameInactive = !Game.IsActive.Value;
|
||||
}
|
||||
|
||||
public void Pause()
|
||||
|
Loading…
Reference in New Issue
Block a user