Figure out what road vehicle EngineIDs to put in the list */
| 1448 | |
| 1449 | /* Figure out what road vehicle EngineIDs to put in the list */ |
| 1450 | void GenerateBuildRoadVehList() |
| 1451 | { |
| 1452 | EngineID sel_id = EngineID::Invalid(); |
| 1453 | |
| 1454 | this->eng_list.clear(); |
| 1455 | |
| 1456 | BadgeTextFilter btf(this->string_filter, GSF_ROADVEHICLES); |
| 1457 | BadgeDropdownFilter bdf(this->badge_filter_choices); |
| 1458 | |
| 1459 | for (const Engine *e : Engine::IterateType(VEH_ROAD)) { |
| 1460 | if (!this->show_hidden_engines && e->IsVariantHidden(_local_company)) continue; |
| 1461 | EngineID eid = e->index; |
| 1462 | if (!IsEngineBuildable(eid, VEH_ROAD, _local_company)) continue; |
| 1463 | if (this->filter.roadtype != INVALID_ROADTYPE && !HasPowerOnRoad(e->VehInfo<RoadVehicleInfo>().roadtype, this->filter.roadtype)) continue; |
| 1464 | if (!bdf.Filter(e->badges)) continue; |
| 1465 | |
| 1466 | /* Filter by name or NewGRF extra text */ |
| 1467 | if (!FilterByText(e) && !btf.Filter(e->badges)) continue; |
| 1468 | |
| 1469 | this->eng_list.emplace_back(eid, e->info.variant_id, e->display_flags, 0); |
| 1470 | |
| 1471 | if (eid == this->sel_engine) sel_id = eid; |
| 1472 | } |
| 1473 | this->SelectEngine(sel_id); |
| 1474 | } |
| 1475 | |
| 1476 | /* Figure out what ship EngineIDs to put in the list */ |
| 1477 | void GenerateBuildShipList() |
no test coverage detected