public bool CheckPosition(Point pos)
{
if (CurrentGameState == GameState.Game && (MainWindow.ScreenManager.Current as GameScreen).ChatBox.TextBox.Focused)
{
return false;
}
// Does the game window have focus?
if (MainWindow.Focused)
{
foreach (Control c in Manager.Controls)
{
if (CurrentGameState == GameState.Game && c == (MainWindow.ScreenManager.Current as GameScreen).ChatBox)
{
continue;
}
if (!CheckControlPos(c, pos))
{
return false;
}
}
// Mouse is not over any controls, but is within the application window.
return true;
}
else
{
return false;
}
}