2022-07-08 22:44:43 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "InstanceCreationTask.h"
|
|
|
|
|
2022-07-31 23:56:14 +01:00
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
#include "minecraft/MinecraftInstance.h"
|
|
|
|
|
2022-07-08 22:44:43 +01:00
|
|
|
#include "modplatform/flame/FileResolvingTask.h"
|
|
|
|
|
|
|
|
#include "net/NetJob.h"
|
|
|
|
|
|
|
|
class FlameCreationTask final : public InstanceCreationTask {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-09-26 10:50:31 +01:00
|
|
|
FlameCreationTask(const QString& staging_path, SettingsObjectPtr global_settings, QWidget* parent)
|
2022-07-08 22:44:43 +01:00
|
|
|
: InstanceCreationTask(), m_parent(parent)
|
|
|
|
{
|
|
|
|
setStagingPath(staging_path);
|
|
|
|
setParentSettings(global_settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool abort() override;
|
|
|
|
|
2022-07-14 20:41:49 +01:00
|
|
|
bool updateInstance() override;
|
2022-07-08 22:44:43 +01:00
|
|
|
bool createInstance() override;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void idResolverSucceeded(QEventLoop&);
|
2022-07-21 20:43:08 +01:00
|
|
|
void setupDownloadJob(QEventLoop&);
|
2022-07-08 22:44:43 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
QWidget* m_parent = nullptr;
|
|
|
|
|
|
|
|
shared_qobject_ptr<Flame::FileResolvingTask> m_mod_id_resolver;
|
2022-07-14 20:41:49 +01:00
|
|
|
Flame::Manifest m_pack;
|
|
|
|
|
|
|
|
// Handle to allow aborting
|
|
|
|
NetJob* m_process_update_file_info_job = nullptr;
|
|
|
|
NetJob::Ptr m_files_job = nullptr;
|
2022-07-31 23:56:14 +01:00
|
|
|
|
|
|
|
std::optional<InstancePtr> m_instance;
|
2022-07-08 22:44:43 +01:00
|
|
|
};
|