summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2006-10-04 00:51:13 +0000
committerbelugas <belugas@openttd.org>2006-10-04 00:51:13 +0000
commit0305adeb12c60edd021c8dc2cc7b82d8771f0d7e (patch)
treeea2a8cb10db709cb9ec98fbf0cbfbac5c54d20da
parentb63b99faeff0cc8bba862a240498e435c4a35e46 (diff)
downloadopenttd-0305adeb12c60edd021c8dc2cc7b82d8771f0d7e.tar.xz
(svn r6634) -Fix(r6377): Do not change a widget state after a DrawWindowWidgets, as it is a bit useless
-Fix(r6562): Use the correct widget index for enabling
-rw-r--r--vehicle_gui.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vehicle_gui.c b/vehicle_gui.c
index 0b56eb0cb..f9c977f84 100644
--- a/vehicle_gui.c
+++ b/vehicle_gui.c
@@ -1575,9 +1575,16 @@ static void DrawVehicleListWindow(Window *w)
default: NOT_REACHED();
}
- DrawWindowWidgets(w);
+ 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);
+ }
- if (owner == _local_player && vl->l.list_length == 0) DisableWindowWidget(w, 9);
+ DrawWindowWidgets(w);
/* draw sorting criteria string */
DrawString(85, 15, _vehicle_sort_listing[vl->l.sort_type], 0x10);