aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-06-04 13:23:38 +0200
committerGitHub <noreply@github.com>2022-06-04 13:23:38 +0200
commit1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f (patch)
treeb72770d610fa6dee00f131a4bbef7c69869d9b21 /launcher/ui
parentcf4949b4f5a29757b3dd24cdca3a010f10e6dadb (diff)
parent5a1de15332bcfbeafff7d0c678d7286ca85cfe18 (diff)
downloadPrismLauncher-1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f.tar.gz
PrismLauncher-1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f.tar.bz2
PrismLauncher-1ab00ca8b260e4ff33c4bc1ed5d0167e210de64f.zip
Merge pull request #426 from flowln/mod_perma
Add on-disk mod metadata information
Diffstat (limited to 'launcher/ui')
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp12
-rw-r--r--launcher/ui/pages/global/LauncherPage.h1
-rw-r--r--launcher/ui/pages/global/LauncherPage.ui75
-rw-r--r--launcher/ui/pages/modplatform/ModPage.cpp2
-rw-r--r--launcher/ui/widgets/MCModInfoFrame.cpp2
5 files changed, 67 insertions, 25 deletions
diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp
index af2e2cd1..faf9272d 100644
--- a/launcher/ui/pages/global/LauncherPage.cpp
+++ b/launcher/ui/pages/global/LauncherPage.cpp
@@ -184,6 +184,11 @@ void LauncherPage::on_modsDirBrowseBtn_clicked()
}
}
+void LauncherPage::on_metadataDisableBtn_clicked()
+{
+ ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
+}
+
void LauncherPage::refreshUpdateChannelList()
{
// Stop listening for selection changes. It's going to change a lot while we update it and
@@ -338,6 +343,9 @@ void LauncherPage::applySettings()
s->set("InstSortMode", "Name");
break;
}
+
+ // Mods
+ s->set("ModMetadataDisabled", ui->metadataDisableBtn->isChecked());
}
void LauncherPage::loadSettings()
{
@@ -440,6 +448,10 @@ void LauncherPage::loadSettings()
{
ui->sortByNameBtn->setChecked(true);
}
+
+ // Mods
+ ui->metadataDisableBtn->setChecked(s->get("DontUseModMetadata").toBool());
+ ui->metadataWarningLabel->setHidden(!ui->metadataDisableBtn->isChecked());
}
void LauncherPage::refreshFontPreview()
diff --git a/launcher/ui/pages/global/LauncherPage.h b/launcher/ui/pages/global/LauncherPage.h
index bbf5d2fe..f38c922e 100644
--- a/launcher/ui/pages/global/LauncherPage.h
+++ b/launcher/ui/pages/global/LauncherPage.h
@@ -88,6 +88,7 @@ slots:
void on_instDirBrowseBtn_clicked();
void on_modsDirBrowseBtn_clicked();
void on_iconsDirBrowseBtn_clicked();
+ void on_metadataDisableBtn_clicked();
/*!
* Updates the list of update channels in the combo box.
diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui
index ae7eb73f..417bbe05 100644
--- a/launcher/ui/pages/global/LauncherPage.ui
+++ b/launcher/ui/pages/global/LauncherPage.ui
@@ -94,19 +94,13 @@
<string>Folders</string>
</property>
<layout class="QGridLayout" name="foldersBoxLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="labelInstDir">
+ <item row="1" column="2">
+ <widget class="QToolButton" name="modsDirBrowseBtn">
<property name="text">
- <string>I&amp;nstances:</string>
- </property>
- <property name="buddy">
- <cstring>instDirTextBox</cstring>
+ <string notr="true">...</string>
</property>
</widget>
</item>
- <item row="0" column="1">
- <widget class="QLineEdit" name="instDirTextBox"/>
- </item>
<item row="0" column="2">
<widget class="QToolButton" name="instDirBrowseBtn">
<property name="text">
@@ -114,43 +108,78 @@
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="labelModsDir">
+ <item row="2" column="2">
+ <widget class="QToolButton" name="iconsDirBrowseBtn">
<property name="text">
- <string>&amp;Mods:</string>
+ <string notr="true">...</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="instDirTextBox"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="labelIconsDir">
+ <property name="text">
+ <string>&amp;Icons:</string>
</property>
<property name="buddy">
- <cstring>modsDirTextBox</cstring>
+ <cstring>iconsDirTextBox</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="modsDirTextBox"/>
</item>
- <item row="1" column="2">
- <widget class="QToolButton" name="modsDirBrowseBtn">
+ <item row="0" column="0">
+ <widget class="QLabel" name="labelInstDir">
<property name="text">
- <string notr="true">...</string>
+ <string>I&amp;nstances:</string>
+ </property>
+ <property name="buddy">
+ <cstring>instDirTextBox</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="iconsDirTextBox"/>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="labelIconsDir">
+ <item row="1" column="0">
+ <widget class="QLabel" name="labelModsDir">
<property name="text">
- <string>&amp;Icons:</string>
+ <string>&amp;Mods:</string>
</property>
<property name="buddy">
- <cstring>iconsDirTextBox</cstring>
+ <cstring>modsDirTextBox</cstring>
</property>
</widget>
</item>
- <item row="2" column="2">
- <widget class="QToolButton" name="iconsDirBrowseBtn">
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="modsBox">
+ <property name="title">
+ <string>Mods</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QCheckBox" name="metadataDisableBtn">
+ <property name="toolTip">
+ <string>Disable using metadata provided by mod providers (like Modrinth or Curseforge) for mods.</string>
+ </property>
<property name="text">
- <string notr="true">...</string>
+ <string>Disable using metadata for mods?</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="metadataWarningLabel">
+ <property name="text">
+ <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600; color:#f5c211;&quot;&gt;Warning&lt;/span&gt;&lt;span style=&quot; color:#f5c211;&quot;&gt;: Disabling mod metadata may also disable some upcoming QoL features, such as mod updating!&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
</property>
</widget>
</item>
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp
index ad36cf2f..5020d44c 100644
--- a/launcher/ui/pages/modplatform/ModPage.cpp
+++ b/launcher/ui/pages/modplatform/ModPage.cpp
@@ -150,7 +150,7 @@ void ModPage::onModSelected()
if (dialog->isModSelected(current.name, version.fileName)) {
dialog->removeSelectedMod(current.name);
} else {
- dialog->addSelectedMod(current.name, new ModDownloadTask(version.downloadUrl, version.fileName, dialog->mods));
+ dialog->addSelectedMod(current.name, new ModDownloadTask(current, version, dialog->mods));
}
updateSelectionButton();
diff --git a/launcher/ui/widgets/MCModInfoFrame.cpp b/launcher/ui/widgets/MCModInfoFrame.cpp
index 8c4bd690..7d78006b 100644
--- a/launcher/ui/widgets/MCModInfoFrame.cpp
+++ b/launcher/ui/widgets/MCModInfoFrame.cpp
@@ -32,7 +32,7 @@ void MCModInfoFrame::updateWithMod(Mod &m)
QString text = "";
QString name = "";
if (m.name().isEmpty())
- name = m.mmc_id();
+ name = m.internal_id();
else
name = m.name();