summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-10 12:30:27 +0000
committerrubidium <rubidium@openttd.org>2008-05-10 12:30:27 +0000
commit935434333badb8376f9dde535ddc50c18e9af3aa (patch)
treea5bdbc9159ef2a9e4438fbff08ec11d3adba7744 /src/news_gui.cpp
parentf23026cce8fa49974e3dd06e00dd073cb45f906b (diff)
downloadopenttd-935434333badb8376f9dde535ddc50c18e9af3aa.tar.xz
(svn r13028) -Codechange: WE_MESSAGE and WE_INVALIDATE_DATA were doing the same thing.
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index cd0482539..0d01c8d42 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -62,6 +62,7 @@ static NewsID _latest_news = INVALID_NEWS; ///< points to last item in fifo que
struct news_d : vp_d {
uint16 follow_vehicle;
+ uint16 chat_height;
int32 scrollpos_x;
int32 scrollpos_y;
int32 dest_scrollpos_x;
@@ -131,7 +132,7 @@ static void NewsWindowProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_CREATE: { // If chatbar is open at creation time, we need to go above it
const Window *w1 = FindWindowById(WC_SEND_NETWORK_MSG, 0);
- w->message.msg = (w1 != NULL) ? w1->height : 0;
+ WP(w, news_d).chat_height = (w1 != NULL) ? w1->height : 0;
break;
}
@@ -231,15 +232,12 @@ static void NewsWindowProc(Window *w, WindowEvent *e)
}
break;
- case WE_MESSAGE: // The chatbar has notified us that is was either created or closed
- switch (e->we.message.msg) {
- case WE_CREATE: w->message.msg = e->we.message.wparam; break;
- case WE_DESTROY: w->message.msg = 0; break;
- }
+ case WE_INVALIDATE_DATA: // The chatbar has notified us that is was either created or closed
+ WP(w, news_d).chat_height = e->we.invalidate.data;
break;
case WE_TICK: { // Scroll up newsmessages from the bottom in steps of 4 pixels
- int y = max(w->top - 4, _screen.height - w->height - 12 - w->message.msg);
+ int y = max(w->top - 4, _screen.height - w->height - 12 - WP(w, news_d).chat_height);
if (y == w->top) return;
if (w->viewport != NULL) {