diff options
author | glx <glx@openttd.org> | 2008-10-25 19:59:11 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-10-25 19:59:11 +0000 |
commit | 48a047d73ba96b241e6aff108fd7cf225679f260 (patch) | |
tree | 774bbab77be99292d9d65e15096b409e4bb814b4 /src/network/network_gui.cpp | |
parent | 31fcb98a3e125e18ab2e02e75df5648b00788381 (diff) | |
download | openttd-48a047d73ba96b241e6aff108fd7cf225679f260.tar.xz |
(svn r14534) -Codechange [FS#2382]: Enumify magic return values of HandleEditBox function (Zuu)
Diffstat (limited to 'src/network/network_gui.cpp')
-rw-r--r-- | src/network/network_gui.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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; } |