Figure out what ship EngineIDs to put in the list */
| 1475 | |
| 1476 | /* Figure out what ship EngineIDs to put in the list */ |
| 1477 | void GenerateBuildShipList() |
| 1478 | { |
| 1479 | EngineID sel_id = EngineID::Invalid(); |
| 1480 | this->eng_list.clear(); |
| 1481 | |
| 1482 | BadgeTextFilter btf(this->string_filter, GSF_SHIPS); |
| 1483 | BadgeDropdownFilter bdf(this->badge_filter_choices); |
| 1484 | |
| 1485 | for (const Engine *e : Engine::IterateType(VEH_SHIP)) { |
| 1486 | if (!this->show_hidden_engines && e->IsVariantHidden(_local_company)) continue; |
| 1487 | EngineID eid = e->index; |
| 1488 | if (!IsEngineBuildable(eid, VEH_SHIP, _local_company)) continue; |
| 1489 | if (!bdf.Filter(e->badges)) continue; |
| 1490 | |
| 1491 | /* Filter by name or NewGRF extra text */ |
| 1492 | if (!FilterByText(e) && !btf.Filter(e->badges)) continue; |
| 1493 | |
| 1494 | this->eng_list.emplace_back(eid, e->info.variant_id, e->display_flags, 0); |
| 1495 | |
| 1496 | if (eid == this->sel_engine) sel_id = eid; |
| 1497 | } |
| 1498 | this->SelectEngine(sel_id); |
| 1499 | } |
| 1500 | |
| 1501 | /* Figure out what aircraft EngineIDs to put in the list */ |
| 1502 | void GenerateBuildAircraftList() |
no test coverage detected