From 77ee09921217eac1540b82978178779eb839d08e Mon Sep 17 00:00:00 2001 From: belugas Date: Wed, 20 Aug 2008 01:29:05 +0000 Subject: (svn r14104) -Feature: Add a window for waypoints, allowing to view all the trains having the selected waypoint in their orders. Changing its name is also supported from the same new window. Gui based on work done by Satyap, on FS#2025. --- src/vehicle_gui.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/vehicle_gui.cpp') diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 84ff470b9..d2e262666 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -789,6 +789,7 @@ struct VehicleListWindow : public Window, public VehicleListBase { case VLW_SHARED_ORDERS: this->widget[VLW_WIDGET_CAPTION].data = STR_VEH_WITH_SHARED_ORDERS_LIST; break; + case VLW_STANDARD: /* Company Name - standard widget setup */ switch (this->vehicle_type) { case VEH_TRAIN: this->widget[VLW_WIDGET_CAPTION].data = STR_881B_TRAINS; break; @@ -798,6 +799,11 @@ struct VehicleListWindow : public Window, public VehicleListBase { default: NOT_REACHED(); break; } break; + + case VLM_WAYPOINT_LIST: + this->widget[VLW_WIDGET_CAPTION].data = STR_WAYPOINT_VIEWPORT; + break; + case VLW_STATION_LIST: /* Station Name */ switch (this->vehicle_type) { case VEH_TRAIN: this->widget[VLW_WIDGET_CAPTION].data = STR_SCHEDULED_TRAINS; break; @@ -893,6 +899,10 @@ struct VehicleListWindow : public Window, public VehicleListBase { SetDParam(1, this->vscroll.count); break; + case VLM_WAYPOINT_LIST: + SetDParam(0, index); + break; + case VLW_STATION_LIST: /* Station Name */ SetDParam(0, index); SetDParam(1, this->vscroll.count); @@ -1167,6 +1177,12 @@ void ShowVehicleListWindow(PlayerID player, VehicleType vehicle_type) } } +void ShowVehicleListWindow(const Waypoint *wp) +{ + if (wp == NULL) return; + ShowVehicleListWindowLocal(GetTileOwner(wp->xy), VLM_WAYPOINT_LIST, VEH_TRAIN, wp->index); +} + void ShowVehicleListWindow(const Vehicle *v) { ShowVehicleListWindowLocal(v->owner, VLW_SHARED_ORDERS, v->type, v->FirstShared()->index); -- cgit v1.2.3-70-g09d2