summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2007-03-13 12:05:41 +0000
committertruelight <truelight@openttd.org>2007-03-13 12:05:41 +0000
commite3f73943f6731885fcb3bbb433e05ec0b0790532 (patch)
tree574fe575ded34a86559062dc95c4deb3485a4713 /src
parent31957860f34a30ee0f9ed2e7be081936641da8da (diff)
downloadopenttd-e3f73943f6731885fcb3bbb433e05ec0b0790532.tar.xz
(svn r9137) -Fix: if all news-setting buttons show 'full', make the ALL-button show 'full' too
Diffstat (limited to 'src')
-rw-r--r--src/news_gui.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 420fc9aef..2c1add796 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -754,11 +754,18 @@ static void MessageOptionsWndProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_CREATE: {
uint32 val = _news_display_opt;
+ uint32 all_val;
int i;
- WP(w, def_d).data_1 = 0;
/* Set up the initial disabled buttons in the case of 'off' or 'full' */
- for (i = 0; i < NT_END; i++, val >>= 2) SetMessageButtonStates(w, val & 0x3, i);
+ all_val = val & 0x3;
+ for (i = 0; i < NT_END; i++, val >>= 2) {
+ SetMessageButtonStates(w, val & 0x3, i);
+ /* If the value doesn't match the ALL-button value, set the ALL-button value to 'off' */
+ if ((val & 0x3) != all_val) all_val = 0;
+ }
+ /* If all values are the same value, the ALL-button will take over this value */
+ WP(w, def_d).data_1 = all_val;
} break;
case WE_PAINT: {