src/station_gui.cpp
changeset 6611 b7c7829c8fc7
parent 6598 06b4750ad778
child 6623 1115fe0767a9
equal deleted inserted replaced
6610:ecaea43b2238 6611:b7c7829c8fc7
   267 
   267 
   268 	sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
   268 	sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS;
   269 	sl->flags &= ~SL_RESORT;
   269 	sl->flags &= ~SL_RESORT;
   270 }
   270 }
   271 
   271 
   272 static uint32 _cargo_filter = std::numeric_limits<uint32>::max();
   272 static const uint32 _cargo_filter_max = ~0;
       
   273 static uint32 _cargo_filter = _cargo_filter_max;
   273 
   274 
   274 static void PlayerStationsWndProc(Window *w, WindowEvent *e)
   275 static void PlayerStationsWndProc(Window *w, WindowEvent *e)
   275 {
   276 {
   276 	const PlayerID owner = (PlayerID)w->window_number;
   277 	const PlayerID owner = (PlayerID)w->window_number;
   277 	static byte facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK;
   278 	static byte facilities = FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK;
   280 
   281 
   281 	plstations_d *sl = &WP(w, plstations_d);
   282 	plstations_d *sl = &WP(w, plstations_d);
   282 
   283 
   283 	switch (e->event) {
   284 	switch (e->event) {
   284 		case WE_CREATE: /* set up resort timer */
   285 		case WE_CREATE: /* set up resort timer */
   285 			if (_cargo_filter == std::numeric_limits<uint32>::max()) _cargo_filter = _cargo_mask;
   286 			if (_cargo_filter == _cargo_filter_max) _cargo_filter = _cargo_mask;
   286 
   287 
   287 			for (uint i = 0; i < 5; i++) {
   288 			for (uint i = 0; i < 5; i++) {
   288 				if (HASBIT(facilities, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_TRAIN);
   289 				if (HASBIT(facilities, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_TRAIN);
   289 			}
   290 			}
   290 			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));
   291 			SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_FACILALL, facilities == (FACIL_TRAIN | FACIL_TRUCK_STOP | FACIL_BUS_STOP | FACIL_AIRPORT | FACIL_DOCK));