summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-07-17 14:53:46 +0000
committerfrosch <frosch@openttd.org>2010-07-17 14:53:46 +0000
commit240e8df0523be8a10eeaf306367b9dff4700ae26 (patch)
treec7549eda4b72a22596bf88e6fb34de99085b3835
parentce480fb4b5adce00719a45f374108833c31748f9 (diff)
downloadopenttd-240e8df0523be8a10eeaf306367b9dff4700ae26.tar.xz
(svn r20171) -Fix: Make the group list action dropdown also use vehicletype-specific texts like the normal vehicle list.
-rw-r--r--src/vehicle_gui.cpp11
-rw-r--r--src/vehicle_gui_base.h1
2 files changed, 10 insertions, 2 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index f53019578..1b3b21a56 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -97,6 +97,13 @@ const StringID BaseVehicleListWindow::vehicle_sorter_names[] = {
INVALID_STRING_ID
};
+const StringID BaseVehicleListWindow::vehicle_depot_name[] = {
+ STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT,
+ STR_VEHICLE_LIST_SEND_ROAD_VEHICLE_TO_DEPOT,
+ STR_VEHICLE_LIST_SEND_SHIP_TO_DEPOT,
+ STR_VEHICLE_LIST_SEND_AIRCRAFT_TO_HANGAR
+};
+
void BaseVehicleListWindow::BuildVehicleList(Owner owner, uint16 index, uint16 window_type)
{
if (!this->vehicles.NeedRebuild()) return;
@@ -136,7 +143,7 @@ Dimension BaseVehicleListWindow::GetActionDropdownSize(bool show_group)
d = maxdim(d, GetStringBoundingBox(STR_VEHICLE_LIST_REPLACE_VEHICLES));
d = maxdim(d, GetStringBoundingBox(STR_VEHICLE_LIST_SEND_FOR_SERVICING));
- d = maxdim(d, GetStringBoundingBox(STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT));
+ d = maxdim(d, GetStringBoundingBox(this->vehicle_depot_name[this->vehicle_type]));
if (show_group) {
d = maxdim(d, GetStringBoundingBox(STR_GROUP_ADD_SHARED_VEHICLE));
@@ -157,7 +164,7 @@ DropDownList *BaseVehicleListWindow::BuildActionDropdownList(bool show_group)
list->push_back(new DropDownListStringItem(STR_VEHICLE_LIST_REPLACE_VEHICLES, ADI_REPLACE, false));
list->push_back(new DropDownListStringItem(STR_VEHICLE_LIST_SEND_FOR_SERVICING, ADI_SERVICE, false));
- list->push_back(new DropDownListStringItem(STR_VEHICLE_LIST_SEND_TRAIN_TO_DEPOT, ADI_DEPOT, false));
+ list->push_back(new DropDownListStringItem(this->vehicle_depot_name[this->vehicle_type], ADI_DEPOT, false));
if (show_group) {
list->push_back(new DropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED, false));
diff --git a/src/vehicle_gui_base.h b/src/vehicle_gui_base.h
index aded315d5..2feda34bc 100644
--- a/src/vehicle_gui_base.h
+++ b/src/vehicle_gui_base.h
@@ -32,6 +32,7 @@ struct BaseVehicleListWindow : public Window {
ADI_REMOVE_ALL,
};
+ static const StringID vehicle_depot_name[];
static const StringID vehicle_sorter_names[];
static GUIVehicleList::SortFunction * const vehicle_sorter_funcs[];