summaryrefslogtreecommitdiff
path: root/src/rail_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2016-12-08 20:21:39 +0000
committerfrosch <frosch@openttd.org>2016-12-08 20:21:39 +0000
commitad43465c31dc9c0ece2add0eb21c813253ee2f4a (patch)
treec0ccd83521b1e0de16144833bed8a4b865b7a94d /src/rail_gui.cpp
parent58fdd3ac984c3e6370a7bb4c37fc6c33ac7ab080 (diff)
downloadopenttd-ad43465c31dc9c0ece2add0eb21c813253ee2f4a.tar.xz
(svn r27683) -Change: Rearrange the autoreplace GUI for trains, and do not filter it by railtype by default.
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r--src/rail_gui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 64a1126d8..e1602db0c 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -1981,9 +1981,10 @@ void InitializeRailGUI()
/**
* Create a drop down list for all the rail types of the local company.
* @param for_replacement Whether this list is for the replacement window.
+ * @param all_option Whether to add an 'all types' item.
* @return The populated and sorted #DropDownList.
*/
-DropDownList *GetRailTypeDropDownList(bool for_replacement)
+DropDownList *GetRailTypeDropDownList(bool for_replacement, bool all_option)
{
RailTypes used_railtypes = RAILTYPES_NONE;
@@ -2000,6 +2001,12 @@ DropDownList *GetRailTypeDropDownList(bool for_replacement)
const Company *c = Company::Get(_local_company);
DropDownList *list = new DropDownList();
+
+ if (all_option) {
+ DropDownListStringItem *item = new DropDownListStringItem(STR_REPLACE_ALL_RAILTYPE, INVALID_RAILTYPE, false);
+ *list->Append() = item;
+ }
+
RailType rt;
FOR_ALL_SORTED_RAILTYPES(rt) {
/* If it's not used ever, don't show it to the user. */