diff options
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_chat_gui.cpp | 6 | ||||
-rw-r--r-- | src/network/network_gui.cpp | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 12cda3a43..22b2df5fe 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -468,14 +468,14 @@ struct NetworkChatWindow : public QueryStringBaseWindow { _chat_tab_completion_active = false; switch (this->HandleEditBoxKey(2, key, keycode, state)) { default: NOT_REACHED(); - case 0: { + case HEBR_EDITING: { Window *osk = FindWindowById(WC_OSK, 0); if (osk != NULL && osk->parent == this) osk->OnInvalidateData(); } break; - case 1: /* Return */ + case HEBR_CONFIRM: SendChat(this->text.buf, this->dtype, this->dest); /* FALLTHROUGH */ - case 2: /* Escape */ delete this; break; + case HEBR_CANCEL: delete this; break; } } return state; diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 9d9fadbbc..0aa429400 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -668,7 +668,7 @@ public: 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 @@ struct NetworkStartServerWindow : public QueryStringBaseWindow { { 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 @@ struct NetworkCompanyPasswordWindow : public QueryStringBaseWindow { { 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; } |