(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)
This commit is contained in:
belugas
2006-10-03 02:08:15 +00:00
parent e383584988
commit 753b572400
21 changed files with 232 additions and 261 deletions

View File

@@ -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);