Fixed a crash after closing screen keyboard when dialog window is active.

Also fixed using screen keyboard with gamepad when it's used in dialog window.
This commit is contained in:
Deve 2019-01-31 22:00:39 +01:00
parent a05889fa6a
commit 575f44a043

View File

@ -404,17 +404,23 @@ void EventHandler::sendNavigationEvent(const NavigationDirection nav, const int
{ {
Widget* w = GUIEngine::getFocusForPlayer(playerID); Widget* w = GUIEngine::getFocusForPlayer(playerID);
if (ScreenKeyboard::isActive() && if (w != NULL)
!ScreenKeyboard::getCurrent()->isMyIrrChild(w->getIrrlichtElement())) {
if (ScreenKeyboard::isActive())
{
if (!ScreenKeyboard::getCurrent()->isMyIrrChild(w->getIrrlichtElement()))
{ {
w = NULL; w = NULL;
} }
}
if (ModalDialog::isADialogActive() && else if (ModalDialog::isADialogActive())
!ModalDialog::getCurrent()->isMyIrrChild(w->getIrrlichtElement())) {
if (!ModalDialog::getCurrent()->isMyIrrChild(w->getIrrlichtElement()))
{ {
w = NULL; w = NULL;
} }
}
}
if (w == NULL) if (w == NULL)
{ {