mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
add setting to controll game assets download
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
e7a03d311c
commit
418222cd6f
5 changed files with 66 additions and 37 deletions
|
|
@ -3,6 +3,7 @@
|
|||
#include <QDebug>
|
||||
#include <QFile>
|
||||
|
||||
#include "Application.h"
|
||||
#include "InstanceTask.h"
|
||||
#include "minecraft/MinecraftLoadAndCheck.h"
|
||||
#include "tasks/SequentialTask.h"
|
||||
|
|
@ -38,8 +39,9 @@ void InstanceCreationTask::executeTask()
|
|||
|
||||
m_instance = createInstance();
|
||||
if (!m_instance) {
|
||||
if (m_abort)
|
||||
if (m_abort) {
|
||||
return;
|
||||
}
|
||||
|
||||
qWarning() << "Instance creation failed!";
|
||||
if (!m_error_message.isEmpty()) {
|
||||
|
|
@ -63,8 +65,9 @@ void InstanceCreationTask::executeTask()
|
|||
qDebug() << "Removing old files";
|
||||
|
||||
for (const QString& path : m_filesToRemove) {
|
||||
if (!QFile::exists(path))
|
||||
if (!QFile::exists(path)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
qDebug() << "Removing" << path;
|
||||
|
||||
|
|
@ -81,6 +84,10 @@ void InstanceCreationTask::executeTask()
|
|||
}
|
||||
|
||||
if (!m_abort) {
|
||||
if (!APPLICATION->settings()->get("DownloadGameFilesDuringInstanceCreation").toBool()) {
|
||||
emitSucceeded();
|
||||
return;
|
||||
}
|
||||
setAbortable(true);
|
||||
setAbortButtonText(tr("Skip"));
|
||||
qDebug() << "Downloading game files";
|
||||
|
|
@ -110,7 +117,7 @@ void InstanceCreationTask::executeTask()
|
|||
}
|
||||
}
|
||||
|
||||
void InstanceCreationTask::scheduleToDelete(QWidget* parent, QDir dir, QString path, bool checkDisabled)
|
||||
void InstanceCreationTask::scheduleToDelete(QWidget* parent, const QDir& dir, const QString& path, bool checkDisabled)
|
||||
{
|
||||
if (path.isEmpty()) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue