PrismLauncher/launcher/modplatform/flame/FlameInstanceCreationTask.h
flow 795d6f35ee
feat: add curseforge modpack updating
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-20 18:36:08 -03:00

39 lines
927 B
C++

#pragma once
#include "InstanceCreationTask.h"
#include "modplatform/flame/FileResolvingTask.h"
#include "net/NetJob.h"
class FlameCreationTask final : public InstanceCreationTask {
Q_OBJECT
public:
FlameCreationTask(QString staging_path, SettingsObjectPtr global_settings, QWidget* parent)
: InstanceCreationTask(), m_parent(parent)
{
setStagingPath(staging_path);
setParentSettings(global_settings);
}
bool abort() override;
bool updateInstance() override;
bool createInstance() override;
private slots:
void idResolverSucceeded(QEventLoop&);
void setupDownloadJob(QEventLoop&);
private:
QWidget* m_parent = nullptr;
shared_qobject_ptr<Flame::FileResolvingTask> m_mod_id_resolver;
Flame::Manifest m_pack;
// Handle to allow aborting
NetJob* m_process_update_file_info_job = nullptr;
NetJob::Ptr m_files_job = nullptr;
};