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

48 lines
1.5 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;
2024-09-02 23:36:42 +02:00
bool createTempDir();
void removeTempDir();
2024-08-30 22:20:33 +02:00
int getChronicleNo(QFile & file);
bool extractGogInstaller(QString filePath);
2024-09-01 02:16:03 +02:00
void createBaseMod() const;
2024-08-31 00:44:20 +02:00
void createChronicleMod(int no);
2024-09-01 02:16:03 +02:00
void extractFiles(int no) const;
2024-08-31 00:44:20 +02:00
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
};