PrismLauncher/launcher/minecraft/mod/tasks/LocalResourcePackParseTask.h
flow 9b984cedac
feat: add image from pack.png to resource packs
Signed-off-by: flow <flowlnlnln@gmail.com>
2022-09-03 13:37:22 -03:00

36 lines
697 B
C++

#pragma once
#include <QDebug>
#include <QObject>
#include "minecraft/mod/ResourcePack.h"
#include "tasks/Task.h"
class LocalResourcePackParseTask : public Task {
Q_OBJECT
public:
LocalResourcePackParseTask(int token, ResourcePack& rp);
[[nodiscard]] bool canAbort() const override { return true; }
bool abort() override;
void executeTask() override;
[[nodiscard]] int token() const { return m_token; }
private:
void processMCMeta(QByteArray&& raw_data);
void processPackPNG(QByteArray&& raw_data);
void processAsFolder();
void processAsZip();
private:
int m_token;
ResourcePack& m_resource_pack;
bool m_aborted = false;
};