chroniclesextractor.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. std::function<void(float percent)> cb;
  16. QDir tempDir;
  17. int extractionFile;
  18. int fileCount;
  19. bool createTempDir();
  20. void removeTempDir();
  21. std::vector<int> getChronicleNo();
  22. bool extractGogInstaller(QString filePath);
  23. void createBaseMod() const;
  24. void createChronicleMod(int no);
  25. void extractFiles(int no) const;
  26. const QStringList chronicles = {
  27. {}, // fake 0th "chronicle", to create 1-based list
  28. "Warlords of the Wasteland",
  29. "Conquest of the Underworld",
  30. "Masters of the Elements",
  31. "Clash of the Dragons",
  32. "The World Tree",
  33. "The Fiery Moon",
  34. "Revolt of the Beastmasters",
  35. "The Sword of Frost",
  36. };
  37. public:
  38. enum ChroniclesInstallResultMask
  39. {
  40. Success = 0,
  41. ExtractError = 0b0001,
  42. InvalidFile = 0b0010,
  43. };
  44. int installChronicles(QStringList exe);
  45. ChroniclesExtractor(QWidget *p, std::function<void(float percent)> cb = nullptr);
  46. };