diff options
author | Darkvater <Darkvater@openttd.org> | 2005-05-17 23:25:18 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2005-05-17 23:25:18 +0000 |
commit | b51c1905465706bc68dd4f6857004cf4246f8828 (patch) | |
tree | 75fae0176d0d0f4f2783c4fe01f038b7a399c5f7 /misc_gui.c | |
parent | 73ea0646ae9b20c7fe751a62ed3fb18eabe3a792 (diff) | |
download | openttd-b51c1905465706bc68dd4f6857004cf4246f8828.tar.xz |
(svn r2348) - Fix: Do not scroll the game with the arrow keys when the chatbox is open
Diffstat (limited to 'misc_gui.c')
-rw-r--r-- | misc_gui.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/misc_gui.c b/misc_gui.c index 63adec321..da59fd96b 100644 --- a/misc_gui.c +++ b/misc_gui.c @@ -930,7 +930,12 @@ void DrawEditBox(Window *w, int wid) static void QueryStringWndProc(Window *w, WindowEvent *e) { static bool closed = false; - switch(e->event) { + switch (e->event) { + case WE_CREATE: + SETBIT(_no_scroll, SCROLL_EDIT); + closed = false; + break; + case WE_PAINT: SetDParam(0, WP(w,querystr_d).caption); DrawWindowWidgets(w); @@ -987,10 +992,6 @@ press_ok:; } } break; - case WE_CREATE: - closed = false; - break; - case WE_DESTROY: // If the window is not closed yet, it means it still needs to send a CANCEL if (!closed) { @@ -1039,7 +1040,6 @@ void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, DeleteWindowById(WC_SAVELOAD, 0); w = AllocateWindowDesc(&_query_string_desc); - SETBIT(_no_scroll, SCROLL_EDIT); GetString(_edit_str_buf, str); _edit_str_buf[realmaxlen] = '\0'; |