MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / rebuildModList

Method rebuildModList

tools/launcher/launcherwindow.cpp:506–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504}
505
506void LauncherWindow::rebuildModList()
507{
508
509 const auto foundMods = enumerateMods();
510
511 std::list<UString> enabledMods;
512
513 for (int i = 0; i < ui->enabledModsList->count(); i++)
514 {
515 auto listItem = ui->enabledModsList->item(i);
516 LogAssert(listItem != nullptr);
517 auto name = listItem->text().toStdString();
518
519 for (const auto &[modDir, modInfo] : foundMods)
520 {
521 if (modInfo.getName() == name)
522 {
523 enabledMods.push_back(modDir);
524 break;
525 }
526 }
527 }
528
529 UString modString;
530 for (const auto &modDir : enabledMods)
531 {
532 if (modString != "")
533 modString += ":";
534 modString += modDir;
535 }
536
537 Options::modList.set(modString);
538}
539
540void LauncherWindow::enableModClicked()
541{

Callers 3

saveConfigMethod · 0.95
enableModClickedMethod · 0.95
disableModClickedMethod · 0.95

Calls 4

enumerateModsFunction · 0.85
countMethod · 0.45
getNameMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected