(svn r6634) -Fix(r6377): Do not change a widget state after a DrawWindowWidgets, as it is a bit useless
authorbelugas
Wed, 04 Oct 2006 00:51:13 +0000
changeset 4722 a61140917301
parent 4721 dc3fd7ee39ac
child 4723 2a9628b79e93
(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
vehicle_gui.c
--- a/vehicle_gui.c	Wed Oct 04 00:27:31 2006 +0000
+++ b/vehicle_gui.c	Wed Oct 04 00:51:13 2006 +0000
@@ -1575,10 +1575,17 @@
 		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);
+	}
+
 	DrawWindowWidgets(w);
 
-	if (owner == _local_player && vl->l.list_length == 0) DisableWindowWidget(w, 9);
-
 	/* draw sorting criteria string */
 	DrawString(85, 15, _vehicle_sort_listing[vl->l.sort_type], 0x10);
 	/* draw arrow pointing up/down for ascending/descending sorting */