summaryrefslogtreecommitdiff
path: root/vehicle_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-10-06 21:44:18 +0000
committerbjarni <bjarni@openttd.org>2006-10-06 21:44:18 +0000
commit13918e7cc9aae9c54349b3d3f8de29b37461cb4d (patch)
tree9e6ae5eb39205151a7c93ebe6dace73900a6cda6 /vehicle_gui.c
parenta01f777fc7c6655b08273577b9743498dbfbf518 (diff)
downloadopenttd-13918e7cc9aae9c54349b3d3f8de29b37461cb4d.tar.xz
(svn r6672) -Codechange: [depot & vehicle windows] applied SetWindowWidgetsDisabledState() and SetWindowWidgetsHiddenState() to depot and vehicle windows
Diffstat (limited to 'vehicle_gui.c')
-rw-r--r--vehicle_gui.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index d41655ab7..57c68bb18 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -1402,10 +1402,12 @@ static void CreateVehicleListWindow(Window *w)
if (player == _local_player) {
HideWindowWidget(w, VLW_WIDGET_OTHER_PLAYER_FILLER);
} else {
- HideWindowWidget(w, VLW_WIDGET_SEND_TO_DEPOT);
- HideWindowWidget(w, VLW_WIDGET_AUTOREPLACE);
- HideWindowWidget(w, VLW_WIDGET_STOP_ALL);
- HideWindowWidget(w, VLW_WIDGET_START_ALL);
+ SetWindowWidgetsHiddenState(w, true,
+ VLW_WIDGET_SEND_TO_DEPOT,
+ VLW_WIDGET_AUTOREPLACE,
+ VLW_WIDGET_STOP_ALL,
+ VLW_WIDGET_START_ALL,
+ WIDGET_LIST_END);
}
/* Set up the window widgets */
@@ -1601,14 +1603,12 @@ static void DrawVehicleListWindow(Window *w)
default: NOT_REACHED();
}
- if (owner == _local_player) {
- bool list_isempty = vl->l.list_length == 0;
-
- SetWindowWidgetDisabledState(w, VLW_WIDGET_SEND_TO_DEPOT, list_isempty);
- SetWindowWidgetDisabledState(w, VLW_WIDGET_AUTOREPLACE, list_isempty);
- SetWindowWidgetDisabledState(w, VLW_WIDGET_STOP_ALL, list_isempty);
- SetWindowWidgetDisabledState(w, VLW_WIDGET_START_ALL, list_isempty);
- }
+ SetWindowWidgetsDisabledState(w, vl->l.list_length == 0,
+ VLW_WIDGET_SEND_TO_DEPOT,
+ VLW_WIDGET_AUTOREPLACE,
+ VLW_WIDGET_STOP_ALL,
+ VLW_WIDGET_START_ALL,
+ WIDGET_LIST_END);
DrawWindowWidgets(w);