src/network/network_gui.cpp
changeset 10295 52982b3d0d84
parent 10292 6da6cf622f82
child 10301 76966696a338
--- a/src/network/network_gui.cpp	Sat Oct 25 18:58:24 2008 +0000
+++ b/src/network/network_gui.cpp	Sat Oct 25 19:59:11 2008 +0000
@@ -668,7 +668,7 @@
 			return state;
 		}
 
-		if (this->HandleEditBoxKey(NGWW_CLIENT, key, keycode, state) == 1) return state; // enter pressed
+		if (this->HandleEditBoxKey(NGWW_CLIENT, key, keycode, state) == HEBR_CONFIRM) return state;
 
 		/* The name is only allowed when it starts with a letter! */
 		if (!StrEmpty(this->edit_str_buf) && this->edit_str_buf[0] != ' ') {
@@ -1047,7 +1047,7 @@
 	{
 		EventState state = ES_NOT_HANDLED;
 		if (this->field == NSSW_GAMENAME) {
-			if (this->HandleEditBoxKey(NSSW_GAMENAME, key, keycode, state) == 1) return state; // enter pressed
+			if (this->HandleEditBoxKey(NSSW_GAMENAME, key, keycode, state) == HEBR_CONFIRM) return state;
 
 			ttd_strlcpy(_settings_client.network.server_name, this->text.buf, sizeof(_settings_client.network.server_name));
 		}
@@ -1906,11 +1906,13 @@
 	{
 		EventState state;
 		switch (this->HandleEditBoxKey(4, key, keycode, state)) {
-			case 1: // Return
+			default: break;
+
+			case HEBR_CONFIRM:
 				this->OnOk();
 				/* FALL THROUGH */
 
-			case 2: // Escape
+			case HEBR_CANCEL:
 				delete this;
 				break;
 		}