136 } |
136 } |
137 |
137 |
138 return (_internal_sort_order & 1) ? sum2 - sum1 : sum1 - sum2; |
138 return (_internal_sort_order & 1) ? sum2 - sum1 : sum1 - sum2; |
139 } |
139 } |
140 |
140 |
|
141 /** |
|
142 * qsort-compatible version of sorting two stations by maximum rating |
|
143 * @param a First object to be sorted, must be of type (const Station *) |
|
144 * @param b Second object to be sorted, must be of type (const Station *) |
|
145 * @return The sort order |
|
146 * @retval >0 a should come before b in the list |
|
147 * @retval <0 b should come before a in the list |
|
148 */ |
141 static int CDECL StationRatingMaxSorter(const void *a, const void *b) |
149 static int CDECL StationRatingMaxSorter(const void *a, const void *b) |
142 { |
150 { |
143 const Station* st1 = *(const Station**)a; |
151 const Station* st1 = *(const Station**)a; |
144 const Station* st2 = *(const Station**)b; |
152 const Station* st2 = *(const Station**)b; |
145 byte maxr1 = 0; |
153 byte maxr1 = 0; |
146 byte maxr2 = 0; |
154 byte maxr2 = 0; |
147 |
155 |
148 for (CargoID j = 0; j < NUM_CARGO; j++) { |
156 for (CargoID j = 0; j < NUM_CARGO; j++) { |
149 if (st1->goods[j].waiting_acceptance & 0xfff) maxr1 = max(maxr1, st1->goods[j].rating); |
157 if (st1->goods[j].enroute_from != INVALID_STATION) maxr1 = max(maxr1, st1->goods[j].rating); |
150 if (st2->goods[j].waiting_acceptance & 0xfff) maxr2 = max(maxr2, st2->goods[j].rating); |
158 if (st2->goods[j].enroute_from != INVALID_STATION) maxr2 = max(maxr2, st2->goods[j].rating); |
151 } |
159 } |
152 |
160 |
153 return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2; |
161 return (_internal_sort_order & 1) ? maxr2 - maxr1 : maxr1 - maxr2; |
154 } |
162 } |
155 |
163 |
156 typedef enum StationListFlags { |
164 enum StationListFlags { |
157 SL_ORDER = 0x01, |
165 SL_ORDER = 0x01, |
158 SL_RESORT = 0x02, |
166 SL_RESORT = 0x02, |
159 SL_REBUILD = 0x04, |
167 SL_REBUILD = 0x04, |
160 } StationListFlags; |
168 }; |
161 |
169 |
162 DECLARE_ENUM_AS_BIT_SET(StationListFlags); |
170 DECLARE_ENUM_AS_BIT_SET(StationListFlags); |
163 |
171 |
164 typedef struct plstations_d { |
172 struct plstations_d { |
165 const Station** sort_list; |
173 const Station** sort_list; |
166 uint16 list_length; |
174 uint16 list_length; |
167 byte sort_type; |
175 byte sort_type; |
168 StationListFlags flags; |
176 StationListFlags flags; |
169 uint16 resort_timer; //was byte refresh_counter; |
177 uint16 resort_timer; //was byte refresh_counter; |
170 } plstations_d; |
178 }; |
171 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d)); |
179 assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(plstations_d)); |
172 |
180 |
173 void RebuildStationLists(void) |
181 void RebuildStationLists() |
174 { |
182 { |
175 Window* const *wz; |
183 Window* const *wz; |
176 |
184 |
177 FOR_ALL_WINDOWS(wz) { |
185 FOR_ALL_WINDOWS(wz) { |
178 Window *w = *wz; |
186 Window *w = *wz; |
259 |
267 |
260 sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; |
268 sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; |
261 sl->flags &= ~SL_RESORT; |
269 sl->flags &= ~SL_RESORT; |
262 } |
270 } |
263 |
271 |
|
272 static const uint32 _cargo_filter_max = ~0; |
|
273 static uint32 _cargo_filter = _cargo_filter_max; |
|
274 |
264 static void PlayerStationsWndProc(Window *w, WindowEvent *e) |
275 static void PlayerStationsWndProc(Window *w, WindowEvent *e) |
265 { |
276 { |
266 static const uint16 CARGO_ALL_SELECTED = 0x1FFF; |
|
267 |
|
268 const PlayerID owner = (PlayerID)w->window_number; |
277 const PlayerID owner = (PlayerID)w->window_number; |
269 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; |
270 static uint16 cargo_filter = CARGO_ALL_SELECTED; |
|
271 static Listing station_sort = {0, 0}; |
279 static Listing station_sort = {0, 0}; |
|
280 static bool include_empty = true; |
272 |
281 |
273 plstations_d *sl = &WP(w, plstations_d); |
282 plstations_d *sl = &WP(w, plstations_d); |
274 |
283 |
275 switch (e->event) { |
284 switch (e->event) { |
276 case WE_CREATE: /* set up resort timer */ |
285 case WE_CREATE: /* set up resort timer */ |
|
286 if (_cargo_filter == _cargo_filter_max) _cargo_filter = _cargo_mask; |
|
287 |
277 for (uint i = 0; i < 5; i++) { |
288 for (uint i = 0; i < 5; i++) { |
278 if (HASBIT(facilities, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_TRAIN); |
289 if (HASBIT(facilities, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_TRAIN); |
279 } |
290 } |
280 for (CargoID i = 0; i < NUM_CARGO; i++) { |
|
281 if (HASBIT(cargo_filter, i)) LowerWindowWidget(w, i + STATIONLIST_WIDGET_CARGOSTART); |
|
282 } |
|
283 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)); |
284 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, cargo_filter == CARGO_ALL_SELECTED); |
292 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty); |
285 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING, HASBIT(cargo_filter, STATIONLIST_WIDGET_NOCARGOWAITING - NUM_CARGO)); |
293 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING, include_empty); |
286 |
294 |
287 sl->sort_list = NULL; |
295 sl->sort_list = NULL; |
288 sl->flags = SL_REBUILD; |
296 sl->flags = SL_REBUILD; |
289 sl->sort_type = station_sort.criteria; |
297 sl->sort_type = station_sort.criteria; |
290 if (station_sort.order) sl->flags |= SL_ORDER; |
298 if (station_sort.order) sl->flags |= SL_ORDER; |
291 sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; |
299 sl->resort_timer = DAY_TICKS * PERIODIC_RESORT_DAYS; |
292 break; |
300 break; |
293 |
301 |
294 case WE_PAINT: { |
302 case WE_PAINT: { |
295 BuildStationsList(sl, owner, facilities, cargo_filter); |
303 BuildStationsList(sl, owner, facilities, _cargo_filter, include_empty); |
296 SortStationsList(sl); |
304 SortStationsList(sl); |
297 |
305 |
298 SetVScrollCount(w, sl->list_length); |
306 SetVScrollCount(w, sl->list_length); |
299 |
307 |
300 /* draw widgets, with player's name in the caption */ |
308 /* draw widgets, with player's name in the caption */ |
438 case STATIONLIST_WIDGET_SORTCRITERIA: |
453 case STATIONLIST_WIDGET_SORTCRITERIA: |
439 case STATIONLIST_WIDGET_SORTDROPBTN: /* select sorting criteria dropdown menu */ |
454 case STATIONLIST_WIDGET_SORTDROPBTN: /* select sorting criteria dropdown menu */ |
440 ShowDropDownMenu(w, _station_sort_listing, sl->sort_type, STATIONLIST_WIDGET_SORTDROPBTN, 0, 0); |
455 ShowDropDownMenu(w, _station_sort_listing, sl->sort_type, STATIONLIST_WIDGET_SORTDROPBTN, 0, 0); |
441 break; |
456 break; |
442 |
457 |
|
458 case STATIONLIST_WIDGET_NOCARGOWAITING: |
|
459 if (_ctrl_pressed) { |
|
460 include_empty = !include_empty; |
|
461 ToggleWidgetLoweredState(w, STATIONLIST_WIDGET_NOCARGOWAITING); |
|
462 } else { |
|
463 for (uint i = STATIONLIST_WIDGET_CARGOSTART; i < w->widget_count; i++) { |
|
464 RaiseWindowWidget(w, i); |
|
465 } |
|
466 |
|
467 _cargo_filter = 0; |
|
468 include_empty = true; |
|
469 |
|
470 LowerWindowWidget(w, STATIONLIST_WIDGET_NOCARGOWAITING); |
|
471 } |
|
472 sl->flags |= SL_REBUILD; |
|
473 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty); |
|
474 SetWindowDirty(w); |
|
475 break; |
|
476 |
443 default: |
477 default: |
444 if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART && e->we.click.widget <= STATIONLIST_WIDGET_NOCARGOWAITING) { //change cargo_filter |
478 if (e->we.click.widget >= STATIONLIST_WIDGET_CARGOSTART) { //change cargo_filter |
|
479 /* Determine the selected cargo type */ |
|
480 CargoID c; |
|
481 int i = 0; |
|
482 for (c = 0; c < NUM_CARGO; c++) { |
|
483 if (!GetCargo(c)->IsValid()) continue; |
|
484 if (e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART == i) break; |
|
485 i++; |
|
486 } |
|
487 |
445 if (_ctrl_pressed) { |
488 if (_ctrl_pressed) { |
446 TOGGLEBIT(cargo_filter, e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART); |
489 TOGGLEBIT(_cargo_filter, c); |
447 ToggleWidgetLoweredState(w, e->we.click.widget); |
490 ToggleWidgetLoweredState(w, e->we.click.widget); |
448 } else { |
491 } else { |
449 for (uint i = 0; cargo_filter != 0; i++, cargo_filter >>= 1) { |
492 for (uint i = STATIONLIST_WIDGET_CARGOSTART; i < w->widget_count; i++) { |
450 if (HASBIT(cargo_filter, 0)) RaiseWindowWidget(w, i + STATIONLIST_WIDGET_CARGOSTART); |
493 RaiseWindowWidget(w, i); |
451 } |
494 } |
452 SETBIT(cargo_filter, e->we.click.widget - STATIONLIST_WIDGET_CARGOSTART); |
495 RaiseWindowWidget(w, STATIONLIST_WIDGET_NOCARGOWAITING); |
|
496 |
|
497 _cargo_filter = 0; |
|
498 include_empty = false; |
|
499 |
|
500 SETBIT(_cargo_filter, c); |
453 LowerWindowWidget(w, e->we.click.widget); |
501 LowerWindowWidget(w, e->we.click.widget); |
454 } |
502 } |
455 sl->flags |= SL_REBUILD; |
503 sl->flags |= SL_REBUILD; |
456 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, cargo_filter == CARGO_ALL_SELECTED); |
504 SetWindowWidgetLoweredState(w, STATIONLIST_WIDGET_CARGOALL, _cargo_filter == _cargo_mask && include_empty); |
457 SetWindowDirty(w); |
505 SetWindowDirty(w); |
458 } |
506 } |
459 break; |
507 break; |
460 } |
508 } |
461 break; |
509 break; |
503 { WWT_TEXTBTN, RESIZE_NONE, 14, 28, 41, 14, 24, STR_BUS, STR_USE_CTRL_TO_SELECT_MORE}, |
551 { WWT_TEXTBTN, RESIZE_NONE, 14, 28, 41, 14, 24, STR_BUS, STR_USE_CTRL_TO_SELECT_MORE}, |
504 { WWT_TEXTBTN, RESIZE_NONE, 14, 42, 55, 14, 24, STR_PLANE, STR_USE_CTRL_TO_SELECT_MORE}, |
552 { WWT_TEXTBTN, RESIZE_NONE, 14, 42, 55, 14, 24, STR_PLANE, STR_USE_CTRL_TO_SELECT_MORE}, |
505 { WWT_TEXTBTN, RESIZE_NONE, 14, 56, 69, 14, 24, STR_SHIP, STR_USE_CTRL_TO_SELECT_MORE}, |
553 { WWT_TEXTBTN, RESIZE_NONE, 14, 56, 69, 14, 24, STR_SHIP, STR_USE_CTRL_TO_SELECT_MORE}, |
506 //Index 11 |
554 //Index 11 |
507 { WWT_PANEL, RESIZE_NONE, 14, 83, 88, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
555 { WWT_PANEL, RESIZE_NONE, 14, 83, 88, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
508 { WWT_PANEL, RESIZE_NONE, 14, 89, 102, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
556 { WWT_PANEL, RESIZE_NONE, 14, 89, 102, 14, 24, 0x0, STR_NO_WAITING_CARGO}, |
509 { WWT_PANEL, RESIZE_NONE, 14, 103, 116, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
557 { WWT_PANEL, RESIZE_RIGHT, 14, 117, 357, 14, 24, 0x0, STR_NULL}, |
510 { WWT_PANEL, RESIZE_NONE, 14, 117, 130, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
558 |
511 { WWT_PANEL, RESIZE_NONE, 14, 131, 144, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
559 //14 |
512 { WWT_PANEL, RESIZE_NONE, 14, 145, 158, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
513 { WWT_PANEL, RESIZE_NONE, 14, 159, 172, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
514 { WWT_PANEL, RESIZE_NONE, 14, 173, 186, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
515 { WWT_PANEL, RESIZE_NONE, 14, 187, 200, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
516 { WWT_PANEL, RESIZE_NONE, 14, 201, 214, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
517 { WWT_PANEL, RESIZE_NONE, 14, 215, 228, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
518 { WWT_PANEL, RESIZE_NONE, 14, 229, 242, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
519 { WWT_PANEL, RESIZE_NONE, 14, 243, 256, 14, 24, 0x0, STR_USE_CTRL_TO_SELECT_MORE}, |
|
520 { WWT_PANEL, RESIZE_NONE, 14, 257, 270, 14, 24, 0x0, STR_NO_WAITING_CARGO}, |
|
521 { WWT_PANEL, RESIZE_RIGHT, 14, 285, 357, 14, 24, 0x0, STR_NULL}, |
|
522 |
|
523 //26 |
|
524 { WWT_PANEL, RESIZE_NONE, 14, 70, 83, 14, 24, 0x0, STR_SELECT_ALL_FACILITIES}, |
560 { WWT_PANEL, RESIZE_NONE, 14, 70, 83, 14, 24, 0x0, STR_SELECT_ALL_FACILITIES}, |
525 { WWT_PANEL, RESIZE_NONE, 14, 271, 284, 14, 24, 0x0, STR_SELECT_ALL_TYPES}, |
561 { WWT_PANEL, RESIZE_NONE, 14, 103, 116, 14, 24, 0x0, STR_SELECT_ALL_TYPES}, |
526 |
562 |
527 //28 |
563 //16 |
528 { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 80, 25, 36, STR_SORT_BY, STR_SORT_ORDER_TIP}, |
564 { WWT_TEXTBTN, RESIZE_NONE, 14, 0, 80, 25, 36, STR_SORT_BY, STR_SORT_ORDER_TIP}, |
529 { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 25, 36, 0x0, STR_SORT_CRITERIA_TIP}, |
565 { WWT_PANEL, RESIZE_NONE, 14, 81, 232, 25, 36, 0x0, STR_SORT_CRITERIA_TIP}, |
530 { WWT_TEXTBTN, RESIZE_NONE, 14, 233, 243, 25, 36, STR_0225, STR_SORT_CRITERIA_TIP}, |
566 { WWT_TEXTBTN, RESIZE_NONE, 14, 233, 243, 25, 36, STR_0225, STR_SORT_CRITERIA_TIP}, |
531 { WWT_PANEL, RESIZE_RIGHT, 14, 244, 357, 25, 36, 0x0, STR_NULL}, |
567 { WWT_PANEL, RESIZE_RIGHT, 14, 244, 357, 25, 36, 0x0, STR_NULL}, |
532 { WIDGETS_END}, |
568 { WIDGETS_END}, |
550 |
586 |
551 w->caption_color = (byte)w->window_number; |
587 w->caption_color = (byte)w->window_number; |
552 w->vscroll.cap = 12; |
588 w->vscroll.cap = 12; |
553 w->resize.step_height = 10; |
589 w->resize.step_height = 10; |
554 w->resize.height = w->height - 10 * 7; // minimum if 5 in the list |
590 w->resize.height = w->height - 10 * 7; // minimum if 5 in the list |
|
591 |
|
592 /* Add cargo filter buttons */ |
|
593 uint num_active = 0; |
|
594 for (CargoID c = 0; c < NUM_CARGO; c++) { |
|
595 if (GetCargo(c)->IsValid()) num_active++; |
|
596 } |
|
597 |
|
598 w->widget_count += num_active; |
|
599 w->widget = ReallocT(w->widget, w->widget_count + 1); |
|
600 w->widget[w->widget_count].type = WWT_LAST; |
|
601 |
|
602 uint i = 0; |
|
603 for (CargoID c = 0; c < NUM_CARGO; c++) { |
|
604 if (!GetCargo(c)->IsValid()) continue; |
|
605 |
|
606 Widget *wi = &w->widget[STATIONLIST_WIDGET_CARGOSTART + i]; |
|
607 wi->type = WWT_PANEL; |
|
608 wi->display_flags = RESIZE_NONE; |
|
609 wi->color = 14; |
|
610 wi->left = 89 + i * 14; |
|
611 wi->right = wi->left + 13; |
|
612 wi->top = 14; |
|
613 wi->bottom = 24; |
|
614 wi->data = 0; |
|
615 wi->tooltips = STR_USE_CTRL_TO_SELECT_MORE; |
|
616 |
|
617 if (HASBIT(_cargo_filter, c)) LowerWindowWidget(w, STATIONLIST_WIDGET_CARGOSTART + i); |
|
618 i++; |
|
619 } |
|
620 |
|
621 w->widget[STATIONLIST_WIDGET_NOCARGOWAITING].left += num_active * 14; |
|
622 w->widget[STATIONLIST_WIDGET_NOCARGOWAITING].right += num_active * 14; |
|
623 w->widget[STATIONLIST_WIDGET_CARGOALL].left += num_active * 14; |
|
624 w->widget[STATIONLIST_WIDGET_CARGOALL].right += num_active * 14; |
|
625 w->widget[13].left += num_active * 14; |
|
626 |
|
627 if (num_active > 15) { |
|
628 /* Resize and fix the minimum width, if necessary */ |
|
629 ResizeWindow(w, (num_active - 15) * 14, 0); |
|
630 w->resize.width = w->width; |
|
631 } |
555 } |
632 } |
556 |
633 |
557 static const Widget _station_view_expanded_widgets[] = { |
634 static const Widget _station_view_expanded_widgets[] = { |
558 { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
635 { WWT_CLOSEBOX, RESIZE_NONE, 14, 0, 10, 0, 13, STR_00C5, STR_018B_CLOSE_WINDOW}, |
559 { WWT_CAPTION, RESIZE_NONE, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
636 { WWT_CAPTION, RESIZE_NONE, 14, 11, 236, 0, 13, STR_300A_0, STR_018C_WINDOW_TITLE_DRAG_THIS}, |
746 ShowQueryString(STR_STATION, STR_3030_RENAME_STATION_LOADING, 31, 180, w, CS_ALPHANUMERAL); |
826 ShowQueryString(STR_STATION, STR_3030_RENAME_STATION_LOADING, 31, 180, w, CS_ALPHANUMERAL); |
747 break; |
827 break; |
748 |
828 |
749 case 10: { /* Show a list of scheduled trains to this station */ |
829 case 10: { /* Show a list of scheduled trains to this station */ |
750 const Station *st = GetStation(w->window_number); |
830 const Station *st = GetStation(w->window_number); |
751 ShowVehicleListWindow(st->owner, VEH_Train, (StationID)w->window_number); |
831 ShowVehicleListWindow(st->owner, VEH_TRAIN, (StationID)w->window_number); |
752 break; |
832 break; |
753 } |
833 } |
754 |
834 |
755 case 11: { /* Show a list of scheduled road-vehicles to this station */ |
835 case 11: { /* Show a list of scheduled road-vehicles to this station */ |
756 const Station *st = GetStation(w->window_number); |
836 const Station *st = GetStation(w->window_number); |
757 ShowVehicleListWindow(st->owner, VEH_Road, (StationID)w->window_number); |
837 ShowVehicleListWindow(st->owner, VEH_ROAD, (StationID)w->window_number); |
758 break; |
838 break; |
759 } |
839 } |
760 |
840 |
761 case 12: { /* Show a list of scheduled aircraft to this station */ |
841 case 12: { /* Show a list of scheduled aircraft to this station */ |
762 const Station *st = GetStation(w->window_number); |
842 const Station *st = GetStation(w->window_number); |
763 /* Since oilrigs have no owners, show the scheduled aircraft of current player */ |
843 /* Since oilrigs have no owners, show the scheduled aircraft of current player */ |
764 PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner; |
844 PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner; |
765 ShowVehicleListWindow(owner, VEH_Aircraft, (StationID)w->window_number); |
845 ShowVehicleListWindow(owner, VEH_AIRCRAFT, (StationID)w->window_number); |
766 break; |
846 break; |
767 } |
847 } |
768 |
848 |
769 case 13: { /* Show a list of scheduled ships to this station */ |
849 case 13: { /* Show a list of scheduled ships to this station */ |
770 const Station *st = GetStation(w->window_number); |
850 const Station *st = GetStation(w->window_number); |
771 /* Since oilrigs/bouys have no owners, show the scheduled ships of current player */ |
851 /* Since oilrigs/bouys have no owners, show the scheduled ships of current player */ |
772 PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner; |
852 PlayerID owner = (st->owner == OWNER_NONE) ? _current_player : st->owner; |
773 ShowVehicleListWindow(owner, VEH_Ship, (StationID)w->window_number); |
853 ShowVehicleListWindow(owner, VEH_SHIP, (StationID)w->window_number); |
774 break; |
854 break; |
775 } |
855 } |
776 } |
856 } |
777 break; |
857 break; |
778 |
858 |