(svn r2251) - Fix: [ 1193945 ] Clicking on the chat text box causes an assertion failure

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
Darkvater 20 years ago
parent 4e1fbe54b2
commit ece616ff22

@ -1368,13 +1368,13 @@ static void ChatWindowWndProc(Window *w, WindowEvent *e)
case WE_PAINT: case WE_PAINT:
DrawWindowWidgets(w); DrawWindowWidgets(w);
DrawEditBox(w, 1); DrawEditBox(w, 2);
break; break;
case WE_CLICK: case WE_CLICK:
switch(e->click.widget) { switch (e->click.widget) {
case 3: DeleteWindow(w); break; // Cancel case 4: DeleteWindow(w); break; // Cancel
case 2: // Send case 3: // Send
press_ok:; press_ok:;
if (strcmp(WP(w, querystr_d).text.buf, WP(w, querystr_d).text.buf + MAX_QUERYSTR_LEN) == 0) { if (strcmp(WP(w, querystr_d).text.buf, WP(w, querystr_d).text.buf + MAX_QUERYSTR_LEN) == 0) {
DeleteWindow(w); DeleteWindow(w);
@ -1406,11 +1406,11 @@ press_ok:;
DeleteWindow(w); DeleteWindow(w);
return; return;
} }
HandleEditBox(w, 1); HandleEditBox(w, 2);
} break; } break;
case WE_KEYPRESS: { case WE_KEYPRESS: {
switch(HandleEditBoxKey(w, 1, e)) { switch (HandleEditBoxKey(w, 2, e)) {
case 1: // Return case 1: // Return
goto press_ok; goto press_ok;
case 2: // Escape case 2: // Escape
@ -1435,10 +1435,11 @@ press_ok:;
} }
static const Widget _chat_window_widgets[] = { static const Widget _chat_window_widgets[] = {
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 639, 0, 13, 0x0, STR_NULL}, // background { WWT_IMGBTN, RESIZE_NONE, 14, 0, 639, 0, 13, STR_NULL, STR_NULL}, // background
{ WWT_IMGBTN, RESIZE_NONE, 14, 2, 399, 1, 12, 0x0, STR_NULL}, // text box { WWT_EMPTY, RESIZE_NONE, 14, 0, 639, 0, 13, STR_NULL, STR_NULL},
{ WWT_TEXTBTN, RESIZE_NONE, 14, 400, 519, 1, 12, STR_NETWORK_SEND,STR_NULL}, // send button { WWT_IMGBTN, RESIZE_NONE, 14, 2, 399, 1, 12, STR_NULL, STR_NULL}, // text box
{ WWT_TEXTBTN, RESIZE_NONE, 14, 520, 639, 1, 12, STR_012E_CANCEL, STR_NULL}, // cancel button { WWT_TEXTBTN, RESIZE_NONE, 14, 400, 519, 1, 12, STR_NETWORK_SEND, STR_NULL}, // send button
{ WWT_TEXTBTN, RESIZE_NONE, 14, 520, 639, 1, 12, STR_012E_CANCEL, STR_NULL}, // cancel button
{ WIDGETS_END}, { WIDGETS_END},
}; };

Loading…
Cancel
Save