| 504 | } |
| 505 | |
| 506 | void 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 | |
| 540 | void LauncherWindow::enableModClicked() |
| 541 | { |
no test coverage detected