summaryrefslogtreecommitdiff
path: root/src/rail_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-01-15 10:36:51 +0000
committerpeter1138 <peter1138@openttd.org>2008-01-15 10:36:51 +0000
commitb4d476b7d1bd43dcd0655a7121b62a571e9bba3b (patch)
tree507d043788c1ef480a0d93c1cd7d54ad1d745c9d /src/rail_gui.cpp
parent327ea903314e4854453d692319c6973fc6ef4238 (diff)
downloadopenttd-b4d476b7d1bd43dcd0655a7121b62a571e9bba3b.tar.xz
(svn r11859) -Codechange: Update newgrf station class dropdown to use new method of generating list.
Diffstat (limited to 'src/rail_gui.cpp')
-rw-r--r--src/rail_gui.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp
index 207c9e1a2..d0a74b420 100644
--- a/src/rail_gui.cpp
+++ b/src/rail_gui.cpp
@@ -27,6 +27,7 @@
#include "sound_func.h"
#include "player_func.h"
#include "settings_type.h"
+#include "widgets/dropdown_type.h"
#include "widgets/dropdown_func.h"
#include "bridge_map.h"
@@ -774,6 +775,18 @@ static void CheckSelectedSize(Window *w, const StationSpec *statspec)
}
}
+static DropDownList *BuildStationClassDropDown()
+{
+ DropDownList *list = new DropDownList();
+
+ for (uint i = 0; i < GetNumStationClasses(); i++) {
+ if (i == STAT_CLASS_WAYP) continue;
+ list->push_back(new DropDownListStringItem(GetStationClassName((StationClassID)i), i, false));
+ }
+
+ return list;
+}
+
static void StationBuildWndProc(Window *w, WindowEvent *e)
{
switch (e->event) {
@@ -992,7 +1005,7 @@ static void StationBuildWndProc(Window *w, WindowEvent *e)
case BRSW_NEWST_DROPDOWN:
case BRSW_NEWST_DROPDOWN_TEXT:
- ShowDropDownMenu(w, BuildStationClassDropdown(), _railstation.station_class, 23, 0, 1 << STAT_CLASS_WAYP);
+ ShowDropDownList(w, BuildStationClassDropDown(), _railstation.station_class, BRSW_NEWST_DROPDOWN_TEXT);
break;
case BRSW_NEWST_LIST: {