(e4064088d) Close in-game interfaces when pressing esc. Currently only registered when the mouse is over the interface. Originally I intended to make it so that pressing esc always closes the open interface. But let's test this.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user