summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2010-07-17 14:36:36 +0000
committerfrosch <frosch@openttd.org>2010-07-17 14:36:36 +0000
commitc79d4f46a35fe1029f1017f243fbf367bb363e45 (patch)
tree98e81339574ee79af058fdf96afc25aaec046f23 /src/vehicle_gui.cpp
parentc5665202e11d3353900a3ef49d805ca44687680c (diff)
downloadopenttd-c79d4f46a35fe1029f1017f243fbf367bb363e45.tar.xz
(svn r20169) -Codechange: Replace ShowGroupActionDropdown() with BaseVehicleListWindow::BuildActionDropdownList().
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index 9fe207320..3cfbfc911 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -125,6 +125,27 @@ void BaseVehicleListWindow::BuildVehicleList(Owner owner, uint16 index, uint16 w
this->vscroll.SetCount(this->vehicles.Length());
}
+/**
+ * Display the Action dropdown window.
+ * @param show_group If true include group-related stuff.
+ * @return Itemlist for dropdown
+ */
+DropDownList *BaseVehicleListWindow::BuildActionDropdownList(bool show_group)
+{
+ DropDownList *list = new DropDownList();
+
+ 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));
+
+ if (show_group) {
+ list->push_back(new DropDownListStringItem(STR_GROUP_ADD_SHARED_VEHICLE, ADI_ADD_SHARED, false));
+ list->push_back(new DropDownListStringItem(STR_GROUP_REMOVE_ALL_VEHICLES, ADI_REMOVE_ALL, false));
+ }
+
+ return list;
+}
+
/* cached values for VehicleNameSorter to spare many GetString() calls */
static const Vehicle *_last_vehicle[2] = { NULL, NULL };