summaryrefslogtreecommitdiff
path: root/src/toolbar_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2010-03-16 06:18:52 +0000
committerpeter1138 <peter1138@openttd.org>2010-03-16 06:18:52 +0000
commitef8deb2edd34f2be07515029b7aebe0f45f853c7 (patch)
treebd96e81138372d2a6f51c5bed9677a9a79886ae8 /src/toolbar_gui.cpp
parente3591f8a1d0b0e5a84cc8b9d45bb5809a622d1f2 (diff)
downloadopenttd-ef8deb2edd34f2be07515029b7aebe0f45f853c7.tar.xz
(svn r19431) -Codechange: Append rail type speed limit (if set) to rail type selection list, and toolbar title.
Diffstat (limited to 'src/toolbar_gui.cpp')
-rw-r--r--src/toolbar_gui.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 8814f5551..1ac6d1705 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -650,7 +650,12 @@ static void ToolbarBuildRailClick(Window *w)
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.menu_text, rt, !HasBit(c->avail_railtypes, rt)));
+
+ StringID str = rti->max_speed > 0 ? STR_TOOLBAR_RAILTYPE_VELOCITY : STR_JUST_STRING;
+ DropDownListParamStringItem *item = new DropDownListParamStringItem(str, rt, !HasBit(c->avail_railtypes, rt));
+ item->SetParam(0, rti->strings.menu_text);
+ item->SetParam(1, rti->max_speed);
+ list->push_back(item);
}
ShowDropDownList(w, list, _last_built_railtype, TBN_RAILS, 140, true, true);
SndPlayFx(SND_15_BEEP);