lotrodatmanager.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef LEGACYAPP_H
  2. #define LEGACYAPP_H
  3. #include <QObject>
  4. #include <QSettings>
  5. #include <QApplication>
  6. #include <QVector>
  7. #include <QVariant>
  8. #include <LotroDat/datfile.h>
  9. #include <LotroDat/database.h>
  10. class LotroDatManager : public QObject
  11. {
  12. Q_OBJECT
  13. public:
  14. struct Status {
  15. };
  16. enum Category : int {
  17. E_TEXTS_COMMON = 100,
  18. E_TEXTS_ITEMS = 101,
  19. E_TEXTS_EMOTES = 102,
  20. E_TEXTS_VIDEOS_REFS = 103,
  21. E_MAPS_COMMON = 200,
  22. E_TEXTURES_COMMON = 201,
  23. E_AUDIOS_COMMON = 300,
  24. E_FONTS_COMMON = 400
  25. };
  26. enum RESOURCE_FILE_TYPE : int {
  27. E_CLIENT_LOCAL = 0,
  28. E_CLIENT_GENERAL = 1
  29. };
  30. public:
  31. ~LotroDatManager();
  32. void init();
  33. bool initialised();
  34. // TODO: bool NotPatched();
  35. bool datPathIsRelevant();
  36. private:
  37. explicit LotroDatManager(QObject *parent = nullptr);
  38. public slots:
  39. void initializeManager();
  40. void deinitializeManager();
  41. void startGame(bool freeze_updates);
  42. void installPatch(QString patch_name, QString database_path, RESOURCE_FILE_TYPE dat_file);
  43. void createBackup();
  44. void restoreFromBackup();
  45. void removeBackup();
  46. signals:
  47. void operationStarted(QString operation_name, QVector<QVariant> args = {});
  48. void errorOccured(QString operation_name, QVector<QVariant> args = {}, QString message = "No error message provided");
  49. void operationFinished(QString operation_name, QVector<QVariant> args = {}, bool successful = true);
  50. void statusChanged(Status status);
  51. private:
  52. LOTRO_DAT::DatFile client_local_file_;
  53. LOTRO_DAT::DatFile client_general_file_;
  54. };
  55. #endif // LEGACYAPP_H