summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2008-10-25 19:59:11 +0000
committerglx <glx@openttd.org>2008-10-25 19:59:11 +0000
commita6bfd7f15bf3fbc1719d736ad06966fa42f171f1 (patch)
tree774bbab77be99292d9d65e15096b409e4bb814b4 /src/network
parent7df85e8a455b27929bad00e7d6e289cc50ba6e18 (diff)
downloadopenttd-a6bfd7f15bf3fbc1719d736ad06966fa42f171f1.tar.xz
(svn r14534) -Codechange [FS#2382]: Enumify magic return values of HandleEditBox function (Zuu)
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_chat_gui.cpp6
-rw-r--r--src/network/network_gui.cpp10
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;
}