chroniclesextractor.h 1.5 KB

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