MCPcopy Create free account
hub / github.com/ElyPrismLauncher/Launcher / changeModVersion

Method changeModVersion

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

Source from the content-addressed store, hash-verified

322}
323
324void ModFolderPage::changeModVersion()
325{
326 if (m_instance->typeName() != "Minecraft")
327 return; // this is a null instance or a legacy instance
328
329 auto profile = static_cast<MinecraftInstance*>(m_instance)->getPackProfile();
330 if (!profile->getModLoaders().has_value()) {
331 if (handleNoModLoader()) {
332 return;
333 }
334 }
335 if (APPLICATION->settings()->get("ModMetadataDisabled").toBool()) {
336 QMessageBox::critical(this, tr("Error"), tr("Mod updates are unavailable when metadata is disabled!"));
337 return;
338 }
339 auto selection = m_filterModel->mapSelectionToSource(ui->treeView->selectionModel()->selection()).indexes();
340 auto mods_list = m_model->selectedMods(selection);
341 if (mods_list.length() != 1 || mods_list[0]->metadata() == nullptr)
342 return;
343
344 m_downloadDialog = new ResourceDownload::ModDownloadDialog(this, m_model, m_instance);
345 connect(this, &QObject::destroyed, m_downloadDialog, &QDialog::close);
346 connect(m_downloadDialog, &QDialog::finished, this, &ModFolderPage::downloadDialogFinished);
347
348 m_downloadDialog->setResourceMetadata((*mods_list.begin())->metadata());
349 m_downloadDialog->open();
350}
351
352void ModFolderPage::exportModMetadata()
353{

Callers

nothing calls this directly

Calls 8

getPackProfileMethod · 0.80
getModLoadersMethod · 0.80
metadataMethod · 0.80
setResourceMetadataMethod · 0.80
typeNameMethod · 0.45
getMethod · 0.45
settingsMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected