mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
(svn r2348) - Fix: Do not scroll the game with the arrow keys when the chatbox is open
This commit is contained in:
parent
9fb4b2ef55
commit
cdb81c660c
12
misc_gui.c
12
misc_gui.c
@ -930,7 +930,12 @@ void DrawEditBox(Window *w, int wid)
|
|||||||
static void QueryStringWndProc(Window *w, WindowEvent *e)
|
static void QueryStringWndProc(Window *w, WindowEvent *e)
|
||||||
{
|
{
|
||||||
static bool closed = false;
|
static bool closed = false;
|
||||||
switch(e->event) {
|
switch (e->event) {
|
||||||
|
case WE_CREATE:
|
||||||
|
SETBIT(_no_scroll, SCROLL_EDIT);
|
||||||
|
closed = false;
|
||||||
|
break;
|
||||||
|
|
||||||
case WE_PAINT:
|
case WE_PAINT:
|
||||||
SetDParam(0, WP(w,querystr_d).caption);
|
SetDParam(0, WP(w,querystr_d).caption);
|
||||||
DrawWindowWidgets(w);
|
DrawWindowWidgets(w);
|
||||||
@ -987,10 +992,6 @@ press_ok:;
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WE_CREATE:
|
|
||||||
closed = false;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WE_DESTROY:
|
case WE_DESTROY:
|
||||||
// If the window is not closed yet, it means it still needs to send a CANCEL
|
// If the window is not closed yet, it means it still needs to send a CANCEL
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
@ -1039,7 +1040,6 @@ void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth,
|
|||||||
DeleteWindowById(WC_SAVELOAD, 0);
|
DeleteWindowById(WC_SAVELOAD, 0);
|
||||||
|
|
||||||
w = AllocateWindowDesc(&_query_string_desc);
|
w = AllocateWindowDesc(&_query_string_desc);
|
||||||
SETBIT(_no_scroll, SCROLL_EDIT);
|
|
||||||
|
|
||||||
GetString(_edit_str_buf, str);
|
GetString(_edit_str_buf, str);
|
||||||
_edit_str_buf[realmaxlen] = '\0';
|
_edit_str_buf[realmaxlen] = '\0';
|
||||||
|
@ -1363,6 +1363,7 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e)
|
|||||||
switch (e->event) {
|
switch (e->event) {
|
||||||
case WE_CREATE:
|
case WE_CREATE:
|
||||||
SendWindowMessage(WC_NEWS_WINDOW, 0, WE_CREATE, w->height, 0);
|
SendWindowMessage(WC_NEWS_WINDOW, 0, WE_CREATE, w->height, 0);
|
||||||
|
SETBIT(_no_scroll, SCROLL_CHAT); // do not scroll the game with the arrow-keys
|
||||||
closed = false;
|
closed = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1421,6 +1422,7 @@ press_ok:;
|
|||||||
|
|
||||||
case WE_DESTROY:
|
case WE_DESTROY:
|
||||||
SendWindowMessage(WC_NEWS_WINDOW, 0, WE_DESTROY, 0, 0);
|
SendWindowMessage(WC_NEWS_WINDOW, 0, WE_DESTROY, 0, 0);
|
||||||
|
CLRBIT(_no_scroll, SCROLL_CHAT);
|
||||||
// If the window is not closed yet, it means it still needs to send a CANCEL
|
// If the window is not closed yet, it means it still needs to send a CANCEL
|
||||||
if (!closed) {
|
if (!closed) {
|
||||||
Window *parent = FindWindowById(WP(w,querystr_d).wnd_class, WP(w,querystr_d).wnd_num);
|
Window *parent = FindWindowById(WP(w,querystr_d).wnd_class, WP(w,querystr_d).wnd_num);
|
||||||
|
Loading…
Reference in New Issue
Block a user