Check if the address field is empty when hitting enter on the multiplayer tab
authorShadowNinja <noreply@gmail.com>
Tue, 2 Apr 2013 02:48:22 +0000 (22:48 -0400)
committerPilzAdam <pilzadam@minetest.net>
Wed, 3 Apr 2013 21:33:17 +0000 (23:33 +0200)
src/guiMainMenu.cpp

index 4c203003985dfdc18a8900f48314e92ecd1907e1..1e30835776a55bcf354b7a55c258210c6ba1a190 100644 (file)
@@ -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;