aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/flame/FlamePage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages/modplatform/flame/FlamePage.cpp')
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
index a65b6585..d288a869 100644
--- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
@@ -197,12 +197,18 @@ void FlamePage::suggestCurrent()
return;
}
- if (selectedVersion.isEmpty() || selectedVersion == "-1") {
+ if (m_selected_version_index == -1) {
dialog->setSuggestedPack();
return;
}
- dialog->setSuggestedPack(current.name, new InstanceImportTask(selectedVersion,this));
+ auto version = current.versions.at(m_selected_version_index);
+
+ QMap<QString, QString> extra_info;
+ extra_info.insert("pack_id", QString::number(current.addonId));
+ extra_info.insert("pack_version_id", QString::number(version.fileId));
+
+ dialog->setSuggestedPack(current.name, new InstanceImportTask(version.downloadUrl, this, extra_info));
QString editedLogoName;
editedLogoName = "curseforge_" + current.logoName.section(".", 0, 0);
listModel->getLogo(current.logoName, current.logoUrl,
@@ -212,10 +218,13 @@ void FlamePage::suggestCurrent()
void FlamePage::onVersionSelectionChanged(QString data)
{
if (data.isNull() || data.isEmpty()) {
- selectedVersion = "";
+ m_selected_version_index = -1;
return;
}
- selectedVersion = ui->versionSelectionBox->currentData().toString();
+
+ m_selected_version_index = ui->versionSelectionBox->currentIndex();
+ Q_ASSERT(current.versions.at(m_selected_version_index).downloadUrl == ui->versionSelectionBox->currentData().toString());
+
suggestCurrent();
}