From 1e361265443f7e2700ec2960953e6f406918865e Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 29 Mar 2019 17:24:45 +0200 Subject: [PATCH] (ab44f999c) Fixed inability to open the pause menu if the cursor is on any UI element, fixed inability to close item UIs with esc if the cursor is not on the UI --- Barotrauma/BarotraumaClient/Source/GameMain.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameMain.cs b/Barotrauma/BarotraumaClient/Source/GameMain.cs index d08306bd4..09c332ced 100644 --- a/Barotrauma/BarotraumaClient/Source/GameMain.cs +++ b/Barotrauma/BarotraumaClient/Source/GameMain.cs @@ -601,7 +601,8 @@ namespace Barotrauma { ((GUIMessageBox)GUIMessageBox.VisibleBox).Close(); } - else if ((GUI.MouseOn == null || GUI.IsMouseOn(GUI.PauseMenu)) && Inventory.SelectedSlot == null && CharacterHealth.OpenHealthWindow == null) + else if ((Character.Controlled?.SelectedConstruction == null || !Character.Controlled.SelectedConstruction.ActiveHUDs.Any(ic => ic.GuiFrame != null)) + && Inventory.SelectedSlot == null && CharacterHealth.OpenHealthWindow == null) { // Otherwise toggle pausing, unless another window/interface is open. GUI.TogglePauseMenu();