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

Method prepareBasicFilter

launcher/ui/widgets/ModFilterWidget.cpp:225–257  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void ModFilterWidget::prepareBasicFilter()
226{
227 m_filter->openSource = false;
228 if (m_instance) {
229 m_filter->hideInstalled = false;
230 m_filter->side = ModPlatform::Side::NoSide; // or "both"
231 ModPlatform::ModLoaderTypes loaders;
232 if (m_instance->settings()->get("OverrideModDownloadLoaders").toBool()) {
233 for (auto loader : Json::toStringList(m_instance->settings()->get("ModDownloadLoaders").toString())) {
234 loaders |= ModPlatform::getModLoaderFromString(loader);
235 }
236 } else {
237 loaders = m_instance->getPackProfile()->getSupportedModLoaders().value();
238 }
239 ui->neoForge->setChecked(loaders & ModPlatform::NeoForge);
240 ui->forge->setChecked(loaders & ModPlatform::Forge);
241 ui->fabric->setChecked(loaders & ModPlatform::Fabric);
242 ui->quilt->setChecked(loaders & ModPlatform::Quilt);
243 ui->liteLoader->setChecked(loaders & ModPlatform::LiteLoader);
244 ui->babric->setChecked(loaders & ModPlatform::Babric);
245 ui->btaBabric->setChecked(loaders & ModPlatform::BTA);
246 ui->legacyFabric->setChecked(loaders & ModPlatform::LegacyFabric);
247 ui->ornithe->setChecked(loaders & ModPlatform::Ornithe);
248 ui->rift->setChecked(loaders & ModPlatform::Rift);
249 m_filter->loaders = loaders;
250 auto def = m_instance->getPackProfile()->getComponentVersion("net.minecraft");
251 m_filter->versions.emplace_back(def);
252 ui->versions->setCheckedItems({ def });
253 ui->version->setCurrentIndex(ui->version->findText(def));
254 } else {
255 ui->hideInstalled->hide();
256 }
257}
258
259void ModFilterWidget::onShowAllVersionsChanged()
260{

Callers

nothing calls this directly

Calls 11

toStringListFunction · 0.85
getModLoaderFromStringFunction · 0.85
valueMethod · 0.80
getPackProfileMethod · 0.80
getComponentVersionMethod · 0.80
setCheckedItemsMethod · 0.80
hideMethod · 0.80
getMethod · 0.45
settingsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected