diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 4f579fb41..6e9cfdada 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -528,9 +528,11 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host) textTitle = std::make_shared("", Rect(20, 20, 205, 50), 0, FONT_BIG, ETextAlignment::CENTER, Colors::WHITE); inputAddress = std::make_shared(Rect(25, 68, 175, 16), background->getSurface()); inputPort = std::make_shared(Rect(25, 115, 175, 16), background->getSurface()); + buttonOk = std::make_shared(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), CGI->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT); if(host && !settings["session"]["donotstartserver"].Bool()) { textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverConnecting")); + buttonOk->block(true); startConnectThread(); } else @@ -539,8 +541,6 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host) inputAddress->cb += std::bind(&CSimpleJoinScreen::onChange, this, _1); inputPort->cb += std::bind(&CSimpleJoinScreen::onChange, this, _1); inputPort->filters += std::bind(&CTextInput::numberFilter, _1, _2, 0, 65535); - buttonOk = std::make_shared(Point(26, 142), AnimationPath::builtin("MUBCHCK.DEF"), CGI->generaltexth->zelp[560], std::bind(&CSimpleJoinScreen::connectToServer, this), EShortcut::GLOBAL_ACCEPT); - inputAddress->giveFocus(); } inputAddress->setText(host ? CServerHandler::localhostAddress : CSH->getHostAddress(), true);