mirror of
https://github.com/PrismLauncher/PrismLauncher
synced 2026-04-23 09:05:03 +00:00
[Backport release-10.x] add more loaders to override setting (#4904)
This commit is contained in:
commit
3e03d47fbf
|
|
@ -115,11 +115,11 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(MinecraftInstancePtr instance,
|
|||
else
|
||||
m_instance->settings()->reset("ModDownloadLoaders");
|
||||
});
|
||||
connect(m_ui->neoForge, &QCheckBox::stateChanged, this, &MinecraftSettingsWidget::saveSelectedLoaders);
|
||||
connect(m_ui->forge, &QCheckBox::stateChanged, this, &MinecraftSettingsWidget::saveSelectedLoaders);
|
||||
connect(m_ui->fabric, &QCheckBox::stateChanged, this, &MinecraftSettingsWidget::saveSelectedLoaders);
|
||||
connect(m_ui->quilt, &QCheckBox::stateChanged, this, &MinecraftSettingsWidget::saveSelectedLoaders);
|
||||
connect(m_ui->liteLoader, &QCheckBox::stateChanged, this, &MinecraftSettingsWidget::saveSelectedLoaders);
|
||||
|
||||
for (auto c : { m_ui->neoForge, m_ui->forge, m_ui->fabric, m_ui->quilt, m_ui->liteLoader, m_ui->babric, m_ui->btaBabric,
|
||||
m_ui->legacyFabric, m_ui->ornithe, m_ui->rift }) {
|
||||
connect(c, &QCheckBox::stateChanged, this, &MinecraftSettingsWidget::saveSelectedLoaders);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->maximizedWarning->hide();
|
||||
|
|
@ -251,12 +251,12 @@ void MinecraftSettingsWidget::loadSettings()
|
|||
m_ui->instanceAccountGroupBox->setChecked(settings->get("UseAccountForInstance").toBool());
|
||||
updateAccountsMenu(*settings);
|
||||
|
||||
auto blockSignalsCheckBoxes = { m_ui->neoForge, m_ui->forge, m_ui->fabric, m_ui->quilt, m_ui->liteLoader,
|
||||
m_ui->babric, m_ui->btaBabric, m_ui->legacyFabric, m_ui->ornithe, m_ui->rift };
|
||||
m_ui->loaderGroup->blockSignals(true);
|
||||
m_ui->neoForge->blockSignals(true);
|
||||
m_ui->forge->blockSignals(true);
|
||||
m_ui->fabric->blockSignals(true);
|
||||
m_ui->quilt->blockSignals(true);
|
||||
m_ui->liteLoader->blockSignals(true);
|
||||
for (auto c : blockSignalsCheckBoxes) {
|
||||
c->blockSignals(true);
|
||||
}
|
||||
|
||||
const bool overrideLoaders = settings->get("OverrideModDownloadLoaders").toBool();
|
||||
const QStringList loaders = Json::toStringList(settings->get("ModDownloadLoaders").toString());
|
||||
|
|
@ -269,6 +269,11 @@ void MinecraftSettingsWidget::loadSettings()
|
|||
m_ui->fabric->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::Fabric)));
|
||||
m_ui->quilt->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::Quilt)));
|
||||
m_ui->liteLoader->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::LiteLoader)));
|
||||
m_ui->babric->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::Babric)));
|
||||
m_ui->btaBabric->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::BTA)));
|
||||
m_ui->legacyFabric->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::LegacyFabric)));
|
||||
m_ui->ornithe->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::Ornithe)));
|
||||
m_ui->rift->setChecked(loaders.contains(getModLoaderAsString(ModPlatform::Rift)));
|
||||
} else {
|
||||
auto instLoaders = m_instance->getPackProfile()->getSupportedModLoaders().value_or(ModPlatform::ModLoaderTypes(0));
|
||||
|
||||
|
|
@ -277,14 +282,17 @@ void MinecraftSettingsWidget::loadSettings()
|
|||
m_ui->fabric->setChecked(instLoaders & ModPlatform::Fabric);
|
||||
m_ui->quilt->setChecked(instLoaders & ModPlatform::Quilt);
|
||||
m_ui->liteLoader->setChecked(instLoaders & ModPlatform::LiteLoader);
|
||||
m_ui->babric->setChecked(instLoaders & ModPlatform::Babric);
|
||||
m_ui->btaBabric->setChecked(instLoaders & ModPlatform::BTA);
|
||||
m_ui->legacyFabric->setChecked(instLoaders & ModPlatform::LegacyFabric);
|
||||
m_ui->ornithe->setChecked(instLoaders & ModPlatform::Ornithe);
|
||||
m_ui->rift->setChecked(instLoaders & ModPlatform::Rift);
|
||||
}
|
||||
|
||||
m_ui->loaderGroup->blockSignals(false);
|
||||
m_ui->neoForge->blockSignals(false);
|
||||
m_ui->forge->blockSignals(false);
|
||||
m_ui->fabric->blockSignals(false);
|
||||
m_ui->quilt->blockSignals(false);
|
||||
m_ui->liteLoader->blockSignals(false);
|
||||
for (auto c : blockSignalsCheckBoxes) {
|
||||
c->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
||||
m_ui->legacySettingsGroupBox->setChecked(settings->get("OverrideLegacySettings").toBool());
|
||||
|
|
@ -522,18 +530,24 @@ void MinecraftSettingsWidget::saveSelectedLoaders()
|
|||
|
||||
if (m_ui->neoForge->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::NeoForge);
|
||||
|
||||
if (m_ui->forge->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::Forge);
|
||||
|
||||
if (m_ui->fabric->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::Fabric);
|
||||
|
||||
if (m_ui->quilt->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::Quilt);
|
||||
|
||||
if (m_ui->liteLoader->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::LiteLoader);
|
||||
if (m_ui->babric->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::Babric);
|
||||
if (m_ui->btaBabric->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::BTA);
|
||||
if (m_ui->legacyFabric->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::LegacyFabric);
|
||||
if (m_ui->ornithe->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::Ornithe);
|
||||
if (m_ui->rift->isChecked())
|
||||
loaders << getModLoaderAsString(ModPlatform::Rift);
|
||||
|
||||
m_instance->settings()->set("ModDownloadLoaders", Json::fromStringList(loaders));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>648</width>
|
||||
<width>653</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
@ -59,8 +59,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>603</width>
|
||||
<height>1042</height>
|
||||
<width>623</width>
|
||||
<height>1352</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
|
|
@ -516,6 +516,41 @@ It is most likely you will need to change the path - please refer to the mod's w
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="babric">
|
||||
<property name="text">
|
||||
<string>Babric</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="btaBabric">
|
||||
<property name="text">
|
||||
<string>BTA (Babric)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="legacyFabric">
|
||||
<property name="text">
|
||||
<string>Legacy Fabric</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ornithe">
|
||||
<property name="text">
|
||||
<string>Ornithe</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="rift">
|
||||
<property name="text">
|
||||
<string>Rift</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -553,8 +588,8 @@ It is most likely you will need to change the path - please refer to the mod's w
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>100</width>
|
||||
<height>30</height>
|
||||
<width>623</width>
|
||||
<height>484</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
@ -577,8 +612,8 @@ It is most likely you will need to change the path - please refer to the mod's w
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>261</width>
|
||||
<height>434</height>
|
||||
<width>609</width>
|
||||
<height>499</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
|
|
|
|||
|
|
@ -241,6 +241,11 @@ void ModFilterWidget::prepareBasicFilter()
|
|||
ui->fabric->setChecked(loaders & ModPlatform::Fabric);
|
||||
ui->quilt->setChecked(loaders & ModPlatform::Quilt);
|
||||
ui->liteLoader->setChecked(loaders & ModPlatform::LiteLoader);
|
||||
ui->babric->setChecked(loaders & ModPlatform::Babric);
|
||||
ui->btaBabric->setChecked(loaders & ModPlatform::BTA);
|
||||
ui->legacyFabric->setChecked(loaders & ModPlatform::LegacyFabric);
|
||||
ui->ornithe->setChecked(loaders & ModPlatform::Ornithe);
|
||||
ui->rift->setChecked(loaders & ModPlatform::Rift);
|
||||
m_filter->loaders = loaders;
|
||||
auto def = m_instance->getPackProfile()->getComponentVersion("net.minecraft");
|
||||
m_filter->versions.emplace_front(def);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>294</width>
|
||||
<height>781</height>
|
||||
<height>817</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
|
|
|
|||
Loading…
Reference in a new issue