(svn r11630) -Fix [FS#1544] (r11556): the chat GUI got broken.
authorrubidium
Thu, 13 Dec 2007 23:26:00 +0000
changeset 8565 1329bb660807
parent 8564 f4a063368ba9
child 8566 94fb2c4351dd
(svn r11630) -Fix [FS#1544] (r11556): the chat GUI got broken.
src/network/network_gui.cpp
--- a/src/network/network_gui.cpp	Thu Dec 13 18:46:04 2007 +0000
+++ b/src/network/network_gui.cpp	Thu Dec 13 23:26:00 2007 +0000
@@ -1794,11 +1794,23 @@
 {
 	switch (e->event) {
 	case WE_CREATE:
+		SendWindowMessage(WC_NEWS_WINDOW, 0, WE_CREATE, w->height, 0);
+		SetBit(_no_scroll, SCROLL_CHAT); // do not scroll the game with the arrow-keys
 		break;
 
 	case WE_PAINT: {
+		static const StringID chat_captions[] = {
+			STR_NETWORK_CHAT_ALL_CAPTION,
+			STR_NETWORK_CHAT_COMPANY_CAPTION,
+			STR_NETWORK_CHAT_CLIENT_CAPTION
+		};
+		StringID msg;
+
 		DrawWindowWidgets(w);
 
+		assert(WP(w, chatquerystr_d).caption < lengthof(chat_captions));
+		msg = chat_captions[WP(w, chatquerystr_d).caption];
+		DrawStringRightAligned(w->widget[2].left - 2, w->widget[2].top + 1, msg, TC_BLACK);
 		DrawEditBox(w, &WP(w, chatquerystr_d), 2);
 	} break;