From: ShadowNinja Date: Tue, 2 Apr 2013 02:48:22 +0000 (-0400) Subject: Check if the address field is empty when hitting enter on the multiplayer tab X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=2a0badf2d565ce4bebe2910c88795c0fe51a0341;p=zefram%2Fminetest%2Fminetest_engine.git Check if the address field is empty when hitting enter on the multiplayer tab --- diff --git a/src/guiMainMenu.cpp b/src/guiMainMenu.cpp index 4c203003..1e308357 100644 --- a/src/guiMainMenu.cpp +++ b/src/guiMainMenu.cpp @@ -1207,6 +1207,15 @@ bool GUIMainMenu::OnEvent(const SEvent& event) switch(event.GUIEvent.Caller->getID()) { case GUI_ID_ADDRESS_INPUT: case GUI_ID_PORT_INPUT: case GUI_ID_NAME_INPUT: case 264: + MainMenuData cur; + readInput(&cur); + if (getTab() == TAB_MULTIPLAYER && cur.address == L"") + { + (new GUIMessageMenu(env, parent, -1, menumgr, + wgettext("Address required.")) + )->drop(); + return true; + } acceptInput(); quitMenu(); return true;