1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/launcher/modManager/chroniclesextractor.h

47 lines
1.4 KiB
C++
Raw Normal View History

2024-08-30 21:17:18 +02:00
/*
* chroniclesextractor.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
#include "../StdInc.h"
class ChroniclesExtractor : public QObject
{
Q_OBJECT
2024-08-30 22:20:33 +02:00
QWidget *parent;
std::function<void(float percent)> cb;
QDir tempDir;
int extractionFile;
int fileCount;
bool handleTempDir(bool create);
int getChronicleNo(QFile & file);
bool extractGogInstaller(QString filePath);
2024-08-31 00:44:20 +02:00
void createBaseMod();
void createChronicleMod(int no);
void extractFiles(int no);
const std::map<int, QByteArray> chronicles = {
{1, QByteArray{reinterpret_cast<const char*>(u"Warlords of the Wasteland"), 50}},
{2, QByteArray{reinterpret_cast<const char*>(u"Conquest of the Underworld"), 52}},
{3, QByteArray{reinterpret_cast<const char*>(u"Masters of the Elements"), 46}},
{4, QByteArray{reinterpret_cast<const char*>(u"Clash of the Dragons"), 40}},
{5, QByteArray{reinterpret_cast<const char*>(u"The World Tree"), 28}},
{6, QByteArray{reinterpret_cast<const char*>(u"The Fiery Moon"), 28}},
{7, QByteArray{reinterpret_cast<const char*>(u"Revolt of the Beastmasters"), 52}},
{8, QByteArray{reinterpret_cast<const char*>(u"The Sword of Frost"), 36}}
};
2024-08-30 21:17:18 +02:00
public:
2024-08-30 22:20:33 +02:00
void installChronicles(QStringList exe);
ChroniclesExtractor(QWidget *p, std::function<void(float percent)> cb = nullptr);
2024-08-31 16:27:39 +02:00
};