(a40a61508) Added: Not drawing cursor when the window is not active

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:41:28 +03:00
parent 84b034b34d
commit 1a5bf77149
3 changed files with 70 additions and 75 deletions
@@ -396,8 +396,11 @@ namespace Barotrauma
{
MouseOn.DrawToolTip(spriteBatch);
}
Cursor.Draw(spriteBatch, PlayerInput.LatestMousePosition, 0, Scale / 2f);
if (GameMain.WindowActive)
{
Cursor.Draw(spriteBatch, PlayerInput.LatestMousePosition, 0, Scale / 2f);
}
}
public static void DrawBackgroundSprite(SpriteBatch spriteBatch, Sprite backgroundSprite, float blurAmount = 1.0f, float aberrationStrength = 1.0f)
@@ -218,6 +218,22 @@ namespace Barotrauma
return true;
}
private bool RefreshJoinButtonState(GUIComponent component, object obj)
{
if (obj == null || waitingForRefresh) { return false; }
if (!string.IsNullOrWhiteSpace(clientNameBox.Text) && !string.IsNullOrWhiteSpace(ipBox.Text))
{
joinButton.Enabled = true;
}
else
{
joinButton.Enabled = false;
}
return true;
}
private bool SelectServer(GUIComponent component, object obj)
{
if (obj == null || waitingForRefresh) { return false; }