summaryrefslogtreecommitdiff
path: root/src/build_vehicle_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-08-24 21:31:24 +0000
committerpeter1138 <peter1138@openttd.org>2008-08-24 21:31:24 +0000
commitff07598ce23d2126e6dbdf6eb4db2bb346e4de11 (patch)
tree927dfaba4b82723d3a08f65704230729ffdb3405 /src/build_vehicle_gui.cpp
parent0d4e7f9537dbaaf7f63c89e71881f352ab12750e (diff)
downloadopenttd-ff07598ce23d2126e6dbdf6eb4db2bb346e4de11.tar.xz
(svn r14157) -Codechange: Add and use string properties for rail types instead of relying on consecutive string IDs.
Diffstat (limited to 'src/build_vehicle_gui.cpp')
-rw-r--r--src/build_vehicle_gui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index cf902cdad..7a2282097 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -1113,7 +1113,14 @@ struct BuildVehicleWindow : Window {
uint max = min(this->vscroll.pos + this->vscroll.cap, this->eng_list.Length());
SetVScrollCount(this, this->eng_list.Length());
- SetDParam(0, this->filter.railtype + STR_881C_NEW_RAIL_VEHICLES); // This should only affect rail vehicles
+ if (this->vehicle_type == VEH_TRAIN) {
+ if (this->filter.railtype == RAILTYPE_END) {
+ SetDParam(0, STR_ALL_AVAIL_RAIL_VEHICLES);
+ } else {
+ const RailtypeInfo *rti = GetRailTypeInfo(this->filter.railtype);
+ SetDParam(0, rti->strings.build_caption);
+ }
+ }
/* Set text of sort by dropdown */
this->widget[BUILD_VEHICLE_WIDGET_SORT_DROPDOWN].data = _sort_listing[this->vehicle_type][this->sort_criteria];