summaryrefslogtreecommitdiff
path: root/src/autoreplace_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-20 12:40:40 +0000
committerrubidium <rubidium@openttd.org>2011-01-20 12:40:40 +0000
commit289206b03338625b39dff675c9be41c39d8e978e (patch)
treebbbe2868eb2df2ece73d5f63303259b8c5ca2934 /src/autoreplace_gui.cpp
parent4682434bc9b4a9768267633ae7a54c8eeb8d3429 (diff)
downloadopenttd-289206b03338625b39dff675c9be41c39d8e978e.tar.xz
(svn r21868) -Fix (r21866 and some more): the changes to the main toolbar rail types dropdown should happen for the autoreplace dropdown as well
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r--src/autoreplace_gui.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 586af963f..e0847351c 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -25,6 +25,7 @@
#include "engine_gui.h"
#include "settings_func.h"
#include "core/geometry_func.hpp"
+#include "rail_gui.h"
#include "table/strings.h"
@@ -420,18 +421,9 @@ public:
this->SetDirty();
break;
- case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: { // Railtype selection dropdown menu
- const Company *c = Company::Get(_local_company);
- DropDownList *list = new DropDownList();
- for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
- const RailtypeInfo *rti = GetRailTypeInfo(rt);
- /* Skip rail type if it has no label */
- if (rti->label == 0) continue;
- list->push_back(new DropDownListStringItem(rti->strings.replace_text, rt, !HasBit(c->avail_railtypes, rt)));
- }
- ShowDropDownList(this, list, sel_railtype, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN);
+ case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: // Railtype selection dropdown menu
+ ShowDropDownList(this, GetRailTypeDropDownList(true), sel_railtype, RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN);
break;
- }
case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: // toggle renew_keep_length
DoCommandP(0, GetCompanySettingIndex("company.renew_keep_length"), Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_CHANGE_COMPANY_SETTING);