| 322 | } |
| 323 | |
| 324 | CoreModFolderPage::CoreModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel> mods, QWidget* parent) |
| 325 | : ModFolderPage(inst, mods, parent) |
| 326 | { |
| 327 | auto mcInst = dynamic_cast<MinecraftInstance*>(m_instance); |
| 328 | if (mcInst) { |
| 329 | auto version = mcInst->getPackProfile(); |
| 330 | if (version && version->getComponent("net.minecraftforge") && version->getComponent("net.minecraft")) { |
| 331 | auto minecraftCmp = version->getComponent("net.minecraft"); |
| 332 | if (!minecraftCmp->m_loaded) { |
| 333 | version->reload(Net::Mode::Offline); |
| 334 | auto update = version->getCurrentTask(); |
| 335 | if (update) { |
| 336 | connect(update.get(), &Task::finished, this, [this] { |
| 337 | if (m_container) { |
| 338 | m_container->refreshContainer(); |
| 339 | } |
| 340 | }); |
| 341 | update->start(); |
| 342 | } |
| 343 | } |
| 344 | } |
| 345 | } |
| 346 | } |
| 347 | |
| 348 | bool CoreModFolderPage::shouldDisplay() const |
| 349 | { |
nothing calls this directly
no test coverage detected