2
0

cmodmanager.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * cmodmanager.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 "cmodlist.h"
  12. class CModManager
  13. {
  14. CModList * modList;
  15. QString settingsPath();
  16. // check-free version of public method
  17. bool doEnableMod(QString mod, bool on);
  18. bool doInstallMod(QString mod, QString archivePath);
  19. bool doUninstallMod(QString mod);
  20. QVariantMap modSettings;
  21. QVariantMap localMods;
  22. QStringList recentErrors;
  23. bool addError(QString modname, QString message);
  24. bool removeModDir(QString mod);
  25. public:
  26. CModManager(CModList * modList);
  27. void resetRepositories();
  28. void loadRepository(QString filename);
  29. void loadModSettings();
  30. void loadMods();
  31. QStringList getErrors();
  32. /// mod management functions. Return true if operation was successful
  33. /// installs mod from zip archive located at archivePath
  34. bool installMod(QString mod, QString archivePath);
  35. bool uninstallMod(QString mod);
  36. bool enableMod(QString mod);
  37. bool disableMod(QString mod);
  38. bool canInstallMod(QString mod);
  39. bool canUninstallMod(QString mod);
  40. bool canEnableMod(QString mod);
  41. bool canDisableMod(QString mod);
  42. };