12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef LOTROMANAGER_H
- #define LOTROMANAGER_H
- #include <QObject>
- #include <QPushButton>
- #include <queue>
- #include <functional>
- #include <LotroDat.h>
- class LotroManager : public QObject
- {
- Q_OBJECT
- private:
- explicit LotroManager(QObject *parent = nullptr);
- public:
- static LotroManager& getInstance() {
- static LotroManager lotro_mgr_instance;
- return lotro_mgr_instance;
- }
- bool execute(QStringList operation);
- bool isBusy();
- private:
- void startGame();
- bool openDatFile(int id);
- void applyPatch(QString name);
- void applyGlobal();
- bool isDatReady();
- int checkDatFile();
- void applyMicroPatch();
- void applyLoadscreens();
- bool setGameLocale(QString locale);
- void changeBaseLocale(QString locale);
- void saveDatFiles();
- void processFile();
- void installMicroPatch();
- void prepareMicroPatch();
- private:
- bool busy_;
- LOTRO_DAT::LOCALE dat_locale_;
- std::vector<LOTRO_DAT::DatFile> dat_files_;
- LOTRO_DAT::Database database_;
- std::deque<QStringList> operations_queue_;
- const std::vector<QString> available_operations_ = {
- "StartGame",
- "SetLocale",
- "ChangeBaseLocale",
- "ApplyGlobal",
- "ApplyPatch",
- "ApplyMicroPatch",
- "ApplyLoadScreens",
- "CheckDatFile",
- "SaveDatFiles"
- };
- signals:
- void dat_operation_started(QString operation);
- void dat_operation_finished(QString operation, QString result = "");
- void update_hint_label(QString head, QString content);
- private slots:
- void on_dat_operation_started(QString operation);
- void on_dat_operation_finished(QString operation, QString result = "");
- };
- #endif // LOTROMANAGER_H
|