summaryrefslogtreecommitdiff
path: root/station_gui.c
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-10-03 02:08:15 +0000
committerbelugas <belugas@openttd.org>2006-10-03 02:08:15 +0000
commit753b5724001079c3352d23a911488044884dcf5b (patch)
treedc2a5593c6d3da96528beb914da8807aea2325e7 /station_gui.c
parente383584988a99dbdfbcd4a63b1f11213a4274355 (diff)
downloadopenttd-753b5724001079c3352d23a911488044884dcf5b.tar.xz
(svn r6619) -Codechange: Use accessors for disabled_state.
Another step toward merging XTDwidget. The only two files not converted (window.h and widget.c) will be done at the very last commit)
Diffstat (limited to 'station_gui.c')
-rw-r--r--station_gui.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/station_gui.c b/station_gui.c
index 4c4dad665..c687e5b2e 100644
--- a/station_gui.c
+++ b/station_gui.c
@@ -541,13 +541,11 @@ static void DrawStationViewWindow(Window *w)
}
SetVScrollCount(w, num);
- w->disabled_state = st->owner == _local_player ? 0 : (1 << 9);
-
- if (!(st->facilities & FACIL_TRAIN)) SETBIT(w->disabled_state, 10);
- if (!(st->facilities & FACIL_TRUCK_STOP) &&
- !(st->facilities & FACIL_BUS_STOP)) SETBIT(w->disabled_state, 11);
- if (!(st->facilities & FACIL_AIRPORT)) SETBIT(w->disabled_state, 12);
- if (!(st->facilities & FACIL_DOCK)) SETBIT(w->disabled_state, 13);
+ SetWindowWidgetDisabledState(w, 9, st->owner != _local_player);
+ SetWindowWidgetDisabledState(w, 10, !(st->facilities & FACIL_TRAIN));
+ SetWindowWidgetDisabledState(w, 11, !(st->facilities & FACIL_TRUCK_STOP) && !(st->facilities & FACIL_BUS_STOP));
+ SetWindowWidgetDisabledState(w, 12, !(st->facilities & FACIL_AIRPORT));
+ SetWindowWidgetDisabledState(w, 13, !(st->facilities & FACIL_DOCK));
SetDParam(0, st->index);
SetDParam(1, st->facilities);