mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(svn r9137) -Fix: if all news-setting buttons show 'full', make the ALL-button show 'full' too
This commit is contained in:
parent
21392c7846
commit
b1e8191040
@ -754,11 +754,18 @@ static void MessageOptionsWndProc(Window *w, WindowEvent *e)
|
|||||||
switch (e->event) {
|
switch (e->event) {
|
||||||
case WE_CREATE: {
|
case WE_CREATE: {
|
||||||
uint32 val = _news_display_opt;
|
uint32 val = _news_display_opt;
|
||||||
|
uint32 all_val;
|
||||||
int i;
|
int i;
|
||||||
WP(w, def_d).data_1 = 0;
|
|
||||||
|
|
||||||
/* Set up the initial disabled buttons in the case of 'off' or 'full' */
|
/* 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;
|
} break;
|
||||||
|
|
||||||
case WE_PAINT: {
|
case WE_PAINT: {
|
||||||
|
Loading…
Reference in New Issue
Block a user