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

Method updateModVersions

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

Source from the content-addressed store, hash-verified

250}
251
252void ModPage::updateModVersions(int prev_count)
253{
254 auto packProfile = (dynamic_cast<MinecraftInstance*>(m_instance))->getPackProfile();
255
256 QString mcVersion = packProfile->getComponentVersion("net.minecraft");
257
258 for (int i = 0; i < current.versions.size(); i++) {
259 auto version = current.versions[i];
260 bool valid = false;
261 for(auto& mcVer : m_filter->versions){
262 //NOTE: Flame doesn't care about loader, so passing it changes nothing.
263 if (validateVersion(version, mcVer.toString(), packProfile->getModLoaders())) {
264 valid = true;
265 break;
266 }
267 }
268
269 // Only add the version if it's valid or using the 'Any' filter, but never if the version is opted out
270 if ((valid || m_filter->versions.empty()) && !optedOut(version))
271 ui->versionSelectionBox->addItem(version.version, QVariant(i));
272 }
273 if (ui->versionSelectionBox->count() == 0 && prev_count != 0) {
274 ui->versionSelectionBox->addItem(tr("No valid version found!"), QVariant(-1));
275 ui->modSelectionButton->setText(tr("Cannot select invalid version :("));
276 }
277
278 updateSelectionButton();
279}
280
281
282void ModPage::updateSelectionButton()

Callers 1

Calls 9

getPackProfileMethod · 0.80
getComponentVersionMethod · 0.80
getModLoadersMethod · 0.80
addItemMethod · 0.80
sizeMethod · 0.45
toStringMethod · 0.45
emptyMethod · 0.45
countMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected