MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShowMissingContentWindow

Function ShowMissingContentWindow

src/newgrf_gui.cpp:1505–1521  ·  view source on GitHub ↗

* Show the content list window with all missing grfs from the given list. * @param list The list of grfs to check for missing / not exactly matching ones. */

Source from the content-addressed store, hash-verified

1503 * @param list The list of grfs to check for missing / not exactly matching ones.
1504 */
1505void ShowMissingContentWindow(const GRFConfigList &list)
1506{
1507 /* Only show the things in the current list, or everything when nothing's selected */
1508 ContentVector cv;
1509 for (const auto &c : list) {
1510 if (c->status != GCS_NOT_FOUND && !c->flags.Test(GRFConfigFlag::Compatible)) continue;
1511
1512 auto ci = std::make_unique<ContentInfo>();
1513 ci->type = CONTENT_TYPE_NEWGRF;
1514 ci->state = ContentInfo::State::DoesNotExist;
1515 ci->name = c->GetName();
1516 ci->unique_id = std::byteswap(c->ident.grfid);
1517 ci->md5sum = c->flags.Test(GRFConfigFlag::Compatible) ? c->original_md5sum : c->ident.md5sum;
1518 cv.push_back(std::move(ci));
1519 }
1520 ShowNetworkContentListWindow(cv.empty() ? nullptr : &cv, CONTENT_TYPE_NEWGRF);
1521}
1522
1523Listing NewGRFWindow::last_sorting = {false, 0};
1524Filtering NewGRFWindow::last_filtering = {false, 0};

Callers 3

OnClickMethod · 0.85
OnClickMethod · 0.85
OnClickMethod · 0.85

Calls 6

byteswapFunction · 0.85
TestMethod · 0.80
push_backMethod · 0.80
GetNameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected