diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-10-24 04:08:38 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-11-01 04:24:11 -0700 |
commit | 028e086960402f685e07163def36d6b5eee1b796 (patch) | |
tree | 27db4b1be6696b6f7c7abde615749aa9f783d7b6 /launcher/modplatform | |
parent | 04b39294ba012721279ca9d009f99f75178fd57a (diff) | |
download | PrismLauncher-028e086960402f685e07163def36d6b5eee1b796.tar.gz PrismLauncher-028e086960402f685e07163def36d6b5eee1b796.tar.bz2 PrismLauncher-028e086960402f685e07163def36d6b5eee1b796.zip |
send blocked mod info to dialog & prototype UI
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/flame/FlameInstanceCreationTask.cpp | 18 | ||||
-rw-r--r-- | launcher/modplatform/modpacksch/FTBPackInstallTask.cpp | 22 |
2 files changed, 26 insertions, 14 deletions
diff --git a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp index 48ac02e0..15e660a9 100644 --- a/launcher/modplatform/flame/FlameInstanceCreationTask.cpp +++ b/launcher/modplatform/flame/FlameInstanceCreationTask.cpp @@ -372,13 +372,20 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop) auto results = m_mod_id_resolver->getResults(); // first check for blocked mods - QString text; - QList<QUrl> urls; + QList<BlockedMod> blocked_mods; auto anyBlocked = false; for (const auto& result : results.files.values()) { if (!result.resolved || result.url.isEmpty()) { - text += QString("%1: <a href='%2'>%2</a><br/>").arg(result.fileName, result.websiteUrl); - urls.append(QUrl(result.websiteUrl)); + + BlockedMod blocked_mod; + blocked_mod.name = result.fileName; + blocked_mod.websiteUrl = result.websiteUrl; + blocked_mod.hash = result.hash; + blocked_mod.matched = false; + blocked_mod.localPath = ""; + + blocked_mods.append(blocked_mod); + anyBlocked = true; } } @@ -388,8 +395,7 @@ void FlameCreationTask::idResolverSucceeded(QEventLoop& loop) auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked mods found"), tr("The following mods were blocked on third party launchers.<br/>" "You will need to manually download them and add them to the modpack"), - text, - urls); + blocked_mods); message_dialog->setModal(true); if (message_dialog->exec()) { diff --git a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp index 7b112d8f..75fda208 100644 --- a/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp +++ b/launcher/modplatform/modpacksch/FTBPackInstallTask.cpp @@ -176,8 +176,7 @@ void PackInstallTask::resolveMods() void PackInstallTask::onResolveModsSucceeded() { - QString text; - QList<QUrl> urls; + QList<BlockedMod> blocked_mods; auto anyBlocked = false; Flame::Manifest results = m_mod_id_resolver_task->getResults(); @@ -191,11 +190,19 @@ void PackInstallTask::onResolveModsSucceeded() // First check for blocked mods if (!results_file.resolved || results_file.url.isEmpty()) { - QString type(local_file.type); + // QString type(local_file.type); + + // type[0] = type[0].toUpper(); + + BlockedMod blocked_mod; + blocked_mod.name = local_file.name; + blocked_mod.websiteUrl = results_file.websiteUrl; + blocked_mod.hash = results_file.hash; + blocked_mod.matched = false; + blocked_mod.localPath = ""; + + blocked_mods.append(blocked_mod); - type[0] = type[0].toUpper(); - text += QString("%1: %2 - <a href='%3'>%3</a><br/>").arg(type, local_file.name, results_file.websiteUrl); - urls.append(QUrl(results_file.websiteUrl)); anyBlocked = true; } else { local_file.url = results_file.url.toString(); @@ -210,8 +217,7 @@ void PackInstallTask::onResolveModsSucceeded() auto message_dialog = new BlockedModsDialog(m_parent, tr("Blocked files found"), tr("The following files are not available for download in third party launchers.<br/>" "You will need to manually download them and add them to the instance."), - text, - urls); + blocked_mods); if (message_dialog->exec() == QDialog::Accepted) createInstance(); |