2022-07-08 05:40:41 +05:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "InstanceCreationTask.h"
|
|
|
|
|
|
|
|
#include "modplatform/modrinth/ModrinthPackManifest.h"
|
|
|
|
|
|
|
|
#include "net/NetJob.h"
|
|
|
|
|
|
|
|
class ModrinthCreationTask final : public InstanceCreationTask {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
ModrinthCreationTask(QString staging_path, SettingsObjectPtr global_settings, QWidget* parent, QString source_url = {})
|
|
|
|
: InstanceCreationTask(), m_parent(parent)
|
|
|
|
{
|
|
|
|
setStagingPath(staging_path);
|
|
|
|
setParentSettings(global_settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool abort() override;
|
|
|
|
bool canAbort() const override { return true; }
|
|
|
|
|
|
|
|
bool updateInstance() override;
|
|
|
|
bool createInstance() override;
|
|
|
|
|
|
|
|
private:
|
2022-07-08 21:30:44 +05:30
|
|
|
bool parseManifest(QString, std::vector<Modrinth::File>&);
|
2022-07-08 05:40:41 +05:30
|
|
|
QString getManagedPackID() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
QWidget* m_parent = nullptr;
|
|
|
|
|
|
|
|
QString minecraftVersion, fabricVersion, quiltVersion, forgeVersion;
|
|
|
|
QString m_managed_id, m_managed_version_id, m_managed_name;
|
|
|
|
QString m_source_url;
|
|
|
|
|
|
|
|
std::vector<Modrinth::File> m_files;
|
|
|
|
NetJob::Ptr m_files_job;
|
|
|
|
};
|