MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / onModSelected

Method onModSelected

launcher/ui/pages/modplatform/ModPage.cpp:225–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void ModPage::onModSelected()
226{
227 if (selectedVersion < 0)
228 return;
229
230 auto& version = current.versions[selectedVersion];
231 if (dialog->isModSelected(current.name, version.fileName)) {
232 dialog->removeSelectedMod(current.name);
233 } else {
234 bool is_indexed = !APPLICATION->settings()->get("ModMetadataDisabled").toBool();
235 dialog->addSelectedMod(current.name, new ModDownloadTask(current, version, dialog->mods, is_indexed));
236 }
237
238 updateSelectionButton();
239
240 /* Force redraw on the mods list when the selection changes */
241 ui->packView->adjustSize();
242}
243
244
245/******** Make changes to the UI ********/

Callers

nothing calls this directly

Calls 5

isModSelectedMethod · 0.80
removeSelectedModMethod · 0.80
addSelectedModMethod · 0.80
getMethod · 0.45
settingsMethod · 0.45

Tested by

no test coverage detected