monitor files for changes

- add fileWatcher to project that monitors changes to most files
      (except map and layout json files)
    - add config setting whether to monitor files for changes (monitor_files)
This commit is contained in:
garakmon
2020-04-08 00:42:38 -04:00
parent 6026266afd
commit 96a870552e
5 changed files with 84 additions and 7 deletions

View File

@@ -41,6 +41,7 @@ public:
this->metatilesZoom = 30;
this->showPlayerView = false;
this->showCursorTile = true;
this->monitorFiles = true;
this->regionMapDimensions = QSize(32, 20);
this->theme = "default";
}
@@ -53,6 +54,7 @@ public:
void setMetatilesZoom(int zoom);
void setShowPlayerView(bool enabled);
void setShowCursorTile(bool enabled);
void setMonitorFiles(bool monitor);
void setRegionMapDimensions(int width, int height);
void setTheme(QString theme);
QString getRecentProject();
@@ -64,6 +66,7 @@ public:
int getMetatilesZoom();
bool getShowPlayerView();
bool getShowCursorTile();
bool getMonitorFiles();
QSize getRegionMapDimensions();
QString getTheme();
protected:
@@ -87,6 +90,7 @@ private:
int metatilesZoom;
bool showPlayerView;
bool showCursorTile;
bool monitorFiles;
QSize regionMapDimensions;
QString theme;
};

View File

@@ -15,6 +15,7 @@
#include <QPair>
#include <QStandardItem>
#include <QVariant>
#include <QFileSystemWatcher>
static QString NONE_MAP_CONSTANT = "MAP_NONE";
static QString NONE_MAP_NAME = "None";
@@ -61,6 +62,7 @@ public:
QMap<int, QString> metatileBehaviorMapInverse;
QMap<QString, QString> facingDirections;
ParseUtil parser;
QFileSystemWatcher fileWatcher;
void set_root(QString);