1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 08:08:47 -05:00

Check if the address field is empty when hitting enter on the multiplayer tab

This commit is contained in:
ShadowNinja 2013-04-01 22:48:22 -04:00 committed by PilzAdam
parent 6b8435cf8c
commit 2a0badf2d5

View 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;