Changeset - r5280:5ea7cefbf1ad
[Not reviewed]
master
0 1 0
belugas - 18 years ago 2006-12-07 21:21:02
belugas@openttd.org
(svn r7428) -Codechange: Give a more explicit name to the enum STATIONLIST_WIDGET_CARGONONE.
It is not "No Cargo selected", but rather station with no cargo waiting, thus STATIONLIST_WIDGET_NOCARGOWAITING.
Hoping it is now clearer for everyone (mainly me...).
Will fix the behaviour next time.
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
station_gui.c
Show inline comments
 
@@ -28,7 +28,7 @@ enum StationListWidgets {
 
	STATIONLIST_WIDGET_AIRPLANE,
 
	STATIONLIST_WIDGET_SHIP,
 
	STATIONLIST_WIDGET_CARGOSTART = 12,
 
	STATIONLIST_WIDGET_CARGONONE = 24,
 
	STATIONLIST_WIDGET_NOCARGOWAITING = 24,
 
	STATIONLIST_WIDGET_FACILALL = 26,
 
	STATIONLIST_WIDGET_CARGOALL,
 
	STATIONLIST_WIDGET_SORTBY,
 
@@ -277,7 +277,7 @@ static void PlayerStationsWndProc(Window
 
		}
 
		SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
 
		SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, cargo_filter == CARGO_ALL_SELECTED);
 
		SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGONONE, cargo_filter == CARGO_NONE_SELECTED);
 
		SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING, cargo_filter == CARGO_NONE_SELECTED);
 

	
 
		sl->sort_list = NULL;
 
		sl->flags = SL_REBUILD;
 
@@ -324,7 +324,7 @@ static void PlayerStationsWndProc(Window
 
				x += 14;
 
			}
 

	
 
			cg_ofst = IsWindowWidgetLowered(w, STATIONLIST_WIDGET_CARGONONE) ? 1 : 0;
 
			cg_ofst = IsWindowWidgetLowered(w, STATIONLIST_WIDGET_NOCARGOWAITING) ? 1 : 0;
 
			DrawString(x + 2 + cg_ofst, y + 2 + cg_ofst, STR_ABBREV_NONE, 16);
 
			x += 14;
 
			cg_ofst = IsWindowWidgetLowered(w, STATIONLIST_WIDGET_CARGOALL) ? 1 : 0;
 
@@ -424,7 +424,7 @@ static void PlayerStationsWndProc(Window
 
			for (i = 0; i < NUM_CARGO; i++) {
 
				LowerWindowWidget(w, i + STATIONLIST_WIDGET_CARGOSTART);
 
			}
 
			RaiseWindowWidget(w, STATIONLIST_WIDGET_CARGONONE);
 
			RaiseWindowWidget(w, STATIONLIST_WIDGET_NOCARGOWAITING);
 
			LowerWindowWidget(w, STATIONLIST_WIDGET_CARGOALL);
 

	
 
			cargo_filter = CARGO_ALL_SELECTED;
 
@@ -446,7 +446,7 @@ static void PlayerStationsWndProc(Window
 
		break;
 

	
 
		default:
 
			if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART && e->we.click.widget <= STATIONLIST_WIDGET_CARGONONE) { //change cargo_filter
 
			if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART && e->we.click.widget <= STATIONLIST_WIDGET_NOCARGOWAITING) { //change cargo_filter
 
				if (_ctrl_pressed) {
 
					TOGGLEBIT(cargo_filter, e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART);
 
					ToggleWidgetLoweredState(w, e->we.click.widget);
0 comments (0 inline, 0 general)