(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

This commit is contained in:
Joonas Rikkonen
2019-03-29 17:24:45 +02:00
parent b375cd3be1
commit 1e36126544
@@ -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();