diff --git a/Barotrauma/BarotraumaClient/Source/GUI/HUDLayoutSettings.cs b/Barotrauma/BarotraumaClient/Source/GUI/HUDLayoutSettings.cs index e395f08c0..1a0b79cd9 100644 --- a/Barotrauma/BarotraumaClient/Source/GUI/HUDLayoutSettings.cs +++ b/Barotrauma/BarotraumaClient/Source/GUI/HUDLayoutSettings.cs @@ -200,6 +200,9 @@ namespace Barotrauma { public static bool CloseHUD(Rectangle rect) { + // Always close when hitting escape + if (PlayerInput.KeyHit(Microsoft.Xna.Framework.Input.Keys.Escape)) { return true; } + //don't close when the cursor is on a UI element if (GUI.MouseOn != null) return false; diff --git a/Barotrauma/BarotraumaClient/Source/GameMain.cs b/Barotrauma/BarotraumaClient/Source/GameMain.cs index ded8f0896..91174caa9 100644 --- a/Barotrauma/BarotraumaClient/Source/GameMain.cs +++ b/Barotrauma/BarotraumaClient/Source/GameMain.cs @@ -601,8 +601,9 @@ namespace Barotrauma { ((GUIMessageBox)GUIMessageBox.VisibleBox).Close(); } - else // Otherwise toggle pausing. + else if (GUI.MouseOn == null && Inventory.SelectedSlot == null && CharacterHealth.OpenHealthWindow == null) { + // Otherwise toggle pausing, unless another window/interface is open. GUI.TogglePauseMenu(); } }