lotromanager.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef LOTROMANAGER_H
  2. #define LOTROMANAGER_H
  3. #include <QObject>
  4. #include <QPushButton>
  5. #include <queue>
  6. #include <functional>
  7. #include <LotroDat.h>
  8. class LotroManager : public QObject
  9. {
  10. Q_OBJECT
  11. private:
  12. explicit LotroManager(QObject *parent = nullptr);
  13. public:
  14. static LotroManager& getInstance() {
  15. static LotroManager lotro_mgr_instance;
  16. return lotro_mgr_instance;
  17. }
  18. bool execute(QString command, QString args, QString name);
  19. bool isBusy();
  20. private:
  21. void startGame();
  22. bool openDatFile(int id);
  23. void applyPatch(QString name);
  24. void applyGlobal();
  25. bool isDatReady();
  26. int checkDatFile();
  27. void applyMicroPatch();
  28. void applyLoadscreens();
  29. bool setGameLocale(QString locale);
  30. void changeBaseLocale(QString locale);
  31. void saveDatFiles();
  32. void processFile();
  33. void installMicroPatch();
  34. void prepareMicroPatch();
  35. private:
  36. bool busy_;
  37. LOTRO_DAT::LOCALE dat_locale_;
  38. std::vector<LOTRO_DAT::DatFile> dat_files_;
  39. LOTRO_DAT::Database database_;
  40. const std::vector<QString> available_operations_ = {
  41. "StartGame",
  42. "SetLocale",
  43. "ChangeBaseLocale",
  44. "ApplyGlobal",
  45. "ApplyPatch",
  46. "ApplyMicroPatch",
  47. "ApplyLoadScreens",
  48. "CheckDatFile",
  49. "SaveDatFiles"
  50. };
  51. signals:
  52. void dat_operation_started(QString command, QString args, QString name);
  53. void dat_operation_finished(QString command, QString args, QString name, QString result = "");
  54. void update_hint_label(QString head, QString content);
  55. private slots:
  56. void on_dat_operation_started(QString command, QString args, QString name);
  57. void on_dat_operation_finished(QString command, QString args, QString name, QString result = "");
  58. };
  59. #endif // LOTROMANAGER_H