| 353 | } |
| 354 | |
| 355 | static DropDownList BuildTownNameDropDown() |
| 356 | { |
| 357 | DropDownList list; |
| 358 | |
| 359 | /* Add and sort newgrf townnames generators */ |
| 360 | const auto &grf_names = GetGRFTownNameList(); |
| 361 | for (uint i = 0; i < grf_names.size(); i++) { |
| 362 | list.push_back(MakeDropDownListStringItem(grf_names[i], BUILTIN_TOWNNAME_GENERATOR_COUNT + i)); |
| 363 | } |
| 364 | std::sort(list.begin(), list.end(), DropDownListStringItem::NatSortFunc); |
| 365 | |
| 366 | size_t newgrf_size = list.size(); |
| 367 | /* Insert newgrf_names at the top of the list */ |
| 368 | if (newgrf_size > 0) { |
| 369 | list.push_back(MakeDropDownListDividerItem()); // separator line |
| 370 | newgrf_size++; |
| 371 | } |
| 372 | |
| 373 | /* Add and sort original townnames generators */ |
| 374 | for (uint i = 0; i < BUILTIN_TOWNNAME_GENERATOR_COUNT; i++) { |
| 375 | list.push_back(MakeDropDownListStringItem(STR_MAPGEN_TOWN_NAME_ORIGINAL_ENGLISH + i, i)); |
| 376 | } |
| 377 | std::sort(list.begin() + newgrf_size, list.end(), DropDownListStringItem::NatSortFunc); |
| 378 | |
| 379 | return list; |
| 380 | } |
| 381 | |
| 382 | |
| 383 | static const StringID _elevations[] = {STR_TERRAIN_TYPE_VERY_FLAT, STR_TERRAIN_TYPE_FLAT, STR_TERRAIN_TYPE_HILLY, STR_TERRAIN_TYPE_MOUNTAINOUS, STR_TERRAIN_TYPE_ALPINIST, STR_TERRAIN_TYPE_CUSTOM}; |
no test coverage detected