MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / CoreModFolderPage

Method CoreModFolderPage

launcher/ui/pages/instance/ModFolderPage.cpp:324–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322}
323
324CoreModFolderPage::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
348bool CoreModFolderPage::shouldDisplay() const
349{

Callers

nothing calls this directly

Calls 7

getPackProfileMethod · 0.80
getComponentMethod · 0.80
reloadMethod · 0.45
getCurrentTaskMethod · 0.45
getMethod · 0.45
refreshContainerMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected