(80eb10d43) Option to automatically pause the game when the window loses focus (on by default)

This commit is contained in:
Joonas Rikkonen
2019-05-06 11:34:17 +03:00
parent 9e7bcbd409
commit f72fd0bf29
6 changed files with 134 additions and 238 deletions
@@ -643,6 +643,13 @@ namespace Barotrauma
paused = (DebugConsole.IsOpen || GUI.PauseMenuOpen || GUI.SettingsMenuOpen || Tutorial.ContentRunning) &&
(NetworkMember == null || !NetworkMember.GameStarted);
#if !DEBUG
if (NetworkMember == null && !WindowActive && Config.PauseOnFocusLost)
{
paused = true;
}
#endif
Screen.Selected.AddToGUIUpdateList();
if (Client != null)