Mercurial > hg > openttd
changeset 11102:ee125c12be2b draft
(svn r15448) -Codechange: Don't show rail types in selection drop downs if they have no label.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Wed, 11 Feb 2009 18:10:12 +0000 |
parents | 6c679f380a53 |
children | 5980315ec1f3 |
files | src/autoreplace_gui.cpp src/toolbar_gui.cpp |
diffstat | 2 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -347,7 +347,8 @@ 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);
--- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -628,6 +628,8 @@ 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.menu_text, rt, !HasBit(c->avail_railtypes, rt))); } ShowDropDownList(w, list, _last_built_railtype, TBN_RAILS, 140, true, true);