(svn r27683) -Change: Rearrange the autoreplace GUI for trains, and do not filter it by railtype by default.
This commit is contained in:
@@ -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. */
|
||||
|
Reference in New Issue
Block a user