123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef LEGACYAPP_H
- #define LEGACYAPP_H
- #include <QObject>
- #include <QSettings>
- #include <QApplication>
- #include <QVector>
- #include <QVariant>
- #include <LotroDat/LotroDat.h>
- using LOTRO_DAT::DatStatus;
- class LotroDatManager : public QObject
- {
- Q_OBJECT
- public:
- using Status = LOTRO_DAT::DatStatus::ProgressInfo;
- enum Category : int {
- E_TEXTS_COMMON = 100,
- E_TEXTS_ITEMS = 101,
- E_TEXTS_EMOTES = 102,
- E_TEXTS_VIDEOS_REFS = 103,
- E_MAPS_COMMON = 200,
- E_TEXTURES_COMMON = 201,
- E_AUDIOS_COMMON = 300,
- E_FONTS_COMMON = 400
- };
- public:
- explicit LotroDatManager(QObject *parent = nullptr);
- ~LotroDatManager();
- bool Initialised();
- bool NotPatched();
- public slots:
- void initializeManager();
- void deinitializeManager();
- void startGame(LOTRO_DAT::DatLocaleManager::LOCALE locale);
- void installPatch(QString patch_name, QString database_path);
- void enableCategory(QString patch_name, LotroDatManager::Category category);
- void disableCategory(QString patch_name, LotroDatManager::Category category);
- void createBackup();
- void restoreFromBackup();
- void removeBackup();
- private:
- bool startLotroLauncherWithParameters(LOTRO_DAT::DatLocaleManager::LOCALE locale);
- signals:
- void operationStarted(QString operation_name, QVector<QVariant> args = {});
- void errorOccured(QString operation_name, QVector<QVariant> args = {}, QString message = "No error message provided");
- void operationFinished(QString operation_name, QVector<QVariant> args = {}, bool successful = true);
- void statusChanged(Status status);
- private:
- LOTRO_DAT::DatFile client_local_file_;
- LOTRO_DAT::DatFile client_general_file_;
- const LOTRO_DAT::DatStatus::Callback file_status_updated_callback_ = [&](Status status) {
- emit statusChanged(status);
- };
- };
- #endif // LEGACYAPP_H
|