Add opt-in for showing mod incompatibilities

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2026-02-12 21:03:59 +00:00
parent b664846030
commit 71278ff7ea
No known key found for this signature in database
GPG key ID: 5E39D70B4C93C38E
4 changed files with 22 additions and 7 deletions

View file

@ -774,6 +774,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
m_settings->registerSetting("ModMetadataDisabled", false);
m_settings->registerSetting("ModDependenciesDisabled", false);
m_settings->registerSetting("SkipModpackUpdatePrompt", false);
m_settings->registerSetting("ShowModIncompat", false);
// Minecraft offline player name
m_settings->registerSetting("LastOfflinePlayerName", "");

View file

@ -503,7 +503,7 @@ bool ResourceFolderModel::validateIndex(const QModelIndex& index) const
// and they only delegate to the superclass for compatible columns
QBrush ResourceFolderModel::rowBackground(int row) const
{
if (m_resources[row]->hasIssues()) {
if (APPLICATION->settings()->get("ShowModIncompat").toBool() && m_resources[row]->hasIssues()) {
return { QColor(255, 0, 0, 40) };
} else {
return {};
@ -538,8 +538,10 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
QString tooltip = m_resources[row]->internal_id();
if (column == NameColumn) {
for (const QString& issue : at(row).issues()) {
tooltip += "\n" + issue;
if (APPLICATION->settings()->get("ShowModIncompat").toBool()) {
for (const QString& issue : at(row).issues()) {
tooltip += "\n" + issue;
}
}
if (at(row).isSymLinkUnder(instDirPath())) {
@ -559,7 +561,7 @@ QVariant ResourceFolderModel::data(const QModelIndex& index, int role) const
}
case Qt::DecorationRole: {
if (column == NameColumn) {
if (at(row).hasIssues()) {
if (APPLICATION->settings()->get("ShowModIncompat").toBool() && at(row).hasIssues()) {
return QIcon::fromTheme("status-bad");
} else if (at(row).isSymLinkUnder(instDirPath()) || at(row).isMoreThanOneHardLink()) {
return QIcon::fromTheme("status-yellow");

View file

@ -244,6 +244,7 @@ void LauncherPage::applySettings()
// Mods
s->set("ModMetadataDisabled", !ui->metadataEnableBtn->isChecked());
s->set("ModDependenciesDisabled", !ui->dependenciesEnableBtn->isChecked());
s->set("ShowModIncompat", ui->showModIncompatCheckBox->isChecked());
s->set("SkipModpackUpdatePrompt", !ui->modpackUpdatePromptBtn->isChecked());
}
void LauncherPage::loadSettings()
@ -293,6 +294,7 @@ void LauncherPage::loadSettings()
ui->metadataEnableBtn->setChecked(!s->get("ModMetadataDisabled").toBool());
ui->metadataWarningLabel->setHidden(ui->metadataEnableBtn->isChecked());
ui->dependenciesEnableBtn->setChecked(!s->get("ModDependenciesDisabled").toBool());
ui->showModIncompatCheckBox->setChecked(s->get("ShowModIncompat").toBool());
ui->modpackUpdatePromptBtn->setChecked(!s->get("SkipModpackUpdatePrompt").toBool());
}

View file

@ -41,9 +41,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-149</y>
<width>746</width>
<height>1194</height>
<height>1222</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
@ -418,6 +418,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showModIncompatCheckBox">
<property name="toolTip">
<string>Currently this just shows mods which are not marked as compatible with the current Minecraft version.</string>
</property>
<property name="text">
<string>Detect and show mod incompatibilities (experimental)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="modpackUpdatePromptBtn">
<property name="toolTip">
@ -671,7 +681,7 @@
<resources/>
<connections/>
<buttongroups>
<buttongroup name="sortingModeGroup"/>
<buttongroup name="renamingBehaviorGroup"/>
<buttongroup name="sortingModeGroup"/>
</buttongroups>
</ui>