| 362 | } |
| 363 | |
| 364 | CoreModFolderPage::CoreModFolderPage(BaseInstance* inst, ModFolderModel* mods, QWidget* parent) : ModFolderPage(inst, mods, parent) |
| 365 | { |
| 366 | auto mcInst = dynamic_cast<MinecraftInstance*>(m_instance); |
| 367 | if (mcInst) { |
| 368 | auto version = mcInst->getPackProfile(); |
| 369 | if (version && version->getComponent("net.minecraftforge") && version->getComponent("net.minecraft")) { |
| 370 | auto minecraftCmp = version->getComponent("net.minecraft"); |
| 371 | if (!minecraftCmp->m_loaded) { |
| 372 | version->reload(Net::Mode::Offline); |
| 373 | auto update = version->getCurrentTask(); |
| 374 | if (update) { |
| 375 | connect(update.get(), &Task::finished, this, [this] { |
| 376 | if (m_container) { |
| 377 | m_container->refreshContainer(); |
| 378 | } |
| 379 | }); |
| 380 | if (!update->isRunning()) { |
| 381 | update->start(); |
| 382 | } |
| 383 | } |
| 384 | } |
| 385 | } |
| 386 | } |
| 387 | } |
| 388 | |
| 389 | bool CoreModFolderPage::shouldDisplay() const |
| 390 | { |
nothing calls this directly
no test coverage detected