summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-08-20 01:29:05 +0000
committerbelugas <belugas@openttd.org>2008-08-20 01:29:05 +0000
commit77ee09921217eac1540b82978178779eb839d08e (patch)
tree814ce35d6f66a7d5595be82243f5c4ba1bcdef9f /src/vehicle_gui.cpp
parentbd6ef958e7f1073dfe9ea8b15c2877a0f9362251 (diff)
downloadopenttd-77ee09921217eac1540b82978178779eb839d08e.tar.xz
(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.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp16
1 files changed, 16 insertions, 0 deletions
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);