diff -r a02ab0ca5ae9 -r 8a0ec0f0f928 src/news_gui.cpp --- a/src/news_gui.cpp Mon Jun 02 01:46:03 2008 +0000 +++ b/src/news_gui.cpp Wed Jun 04 22:34:45 2008 +0000 @@ -168,9 +168,11 @@ struct NewsWindow : Window { uint16 chat_height; NewsItem *ni; + static uint duration; NewsWindow(const WindowDesc *desc, NewsItem *ni) : Window(desc), ni(ni) { + NewsWindow::duration = 555; const Window *w = FindWindowById(WC_SEND_NETWORK_MSG, 0); this->chat_height = (w != NULL) ? w->height : 0; @@ -258,7 +260,7 @@ { switch (widget) { case 1: - this->ni->duration = 0; + NewsWindow::duration = 0; delete this; _forced_news = NULL; break; @@ -314,6 +316,8 @@ } }; +/* static */ uint NewsWindow::duration; ///< Remaining time for showing current news message + static const Widget _news_type13_widgets[] = { { WWT_PANEL, RESIZE_NONE, 15, 0, 429, 0, 169, 0x0, STR_NULL}, @@ -360,9 +364,6 @@ /** Open up an own newspaper window for the news item */ static void ShowNewspaper(NewsItem *ni) { - ni->flags &= ~NF_FORCE_BIG; - ni->duration = 555; - SoundFx sound = _news_type_data[_news_subtype_data[ni->subtype].type].sound; if (sound != 0) SndPlayFx(sound); @@ -438,10 +439,10 @@ if (IsNewsTickerShown()) return false; /* Newspaper message, decrement duration counter */ - if (ni->duration != 0) ni->duration--; + if (NewsWindow::duration != 0) NewsWindow::duration--; /* neither newsticker nor newspaper are running */ - return (ni->duration == 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL); + return (NewsWindow::duration == 0 || FindWindowById(WC_NEWS_WINDOW, 0) == NULL); } /** Move to the next news item */ @@ -465,12 +466,9 @@ InvalidateWindowData(WC_STATUS_BAR, 0, SBI_SHOW_REMINDER); break; - case ND_SUMMARY: // Summary - show ticker, but if forced big, cascade to full - if (!(ni->flags & NF_FORCE_BIG)) { - ShowTicker(ni); - break; - } - /* Fallthrough */ + case ND_SUMMARY: // Summary - show ticker + ShowTicker(ni); + break; case ND_FULL: // Full - show newspaper ShowNewspaper(ni); @@ -613,8 +611,6 @@ _forced_news = ni; if (_forced_news != NULL) { - ni->duration = 555; - ni->flags |= NF_FORCE_BIG; DeleteWindowById(WC_NEWS_WINDOW, 0); ShowNewspaper(ni); }