diff options
author | Darkvater <darkvater@openttd.org> | 2005-04-13 23:03:31 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-04-13 23:03:31 +0000 |
commit | febae668fec6ebb3fffc9ff038e9cfab0f3f0a39 (patch) | |
tree | 6b6a8aa05e22c1c6f0d84cdc20bbc1a190e9f7c4 /main_gui.c | |
parent | 7f4b636559e6c4b7a5ba6d34eff17965d57fa617 (diff) | |
download | openttd-febae668fec6ebb3fffc9ff038e9cfab0f3f0a39.tar.xz |
(svn r2192) - Add greater control to the 'message options' window. Now you can turn off the telegraphc ticker sound for summarized messages, or turn off news-messages altogether (you get a red blot to notify you though). The [<][>] set the settings in one way, while clicking on the option itself, cycles it. This commit also 'fixes' bugs [1166973], [1121484] and patch [1169930].
- I also changed an order of strings from On, Off to Off, On, so this can be used ingame with the WWT_4 widget type.
- Since the newssettings now take 2 bits per setting (off/summary/on) _news_display_opt is widened to 32 bits and the settings code changed slightly to accomodate for a maximum of 16 message-types.
Diffstat (limited to 'main_gui.c')
-rw-r--r-- | main_gui.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/main_gui.c b/main_gui.c index 2808a6312..818631556 100644 --- a/main_gui.c +++ b/main_gui.c @@ -2238,6 +2238,9 @@ static void StatusBarWndProc(Window *w, WindowEvent *e) DrawStringCentered(320, 1, STR_02BA, 0); } } + + if (WP(w, def_d).data_2 > 0) + DrawSprite(SPR_BLOT | PALETTE_TO_RED, 489, 2); break; case WE_CLICK: @@ -2251,10 +2254,20 @@ static void StatusBarWndProc(Window *w, WindowEvent *e) break; case WE_TICK: { - if (_pause || WP(w,def_d).data_1 <= -1280) - return; - WP(w,def_d).data_1 -= 2; - InvalidateWidget(w, 1); + if (_pause) return; + + if (WP(w, def_d).data_1 > -1280) { /* Scrolling text */ + WP(w, def_d).data_1 -= 2; + InvalidateWidget(w, 1); + } + + if (WP(w, def_d).data_2 > 0) { /* Red blot to show there are new unread newsmessages */ + WP(w, def_d).data_2 -= 2; + } else if (WP(w, def_d).data_2 < 0) { + WP(w, def_d).data_2 = 0; + InvalidateWidget(w, 1); + } + break; } } |