#ifndef PROJECTSETTINGSEDITOR_H #define PROJECTSETTINGSEDITOR_H #include #include "project.h" #include "ui_projectsettingseditor.h" class NoScrollComboBox; class QAbstractButton; namespace Ui { class ProjectSettingsEditor; } class ProjectSettingsEditor : public QMainWindow { Q_OBJECT public: explicit ProjectSettingsEditor(QWidget *parent = nullptr, Project *project = nullptr); ~ProjectSettingsEditor(); static const int eventsTab; void setTab(int index); signals: void reloadProject(); private: Ui::ProjectSettingsEditor *ui; Project *project; bool hasUnsavedChanges = false; bool projectNeedsReload = false; bool refreshing = false; const QString baseDir; QHash editedPokemonIconPaths; QString prevIconSpecies; void initUi(); void connectSignals(); void restoreWindowState(); void save(); void refresh(); void closeEvent(QCloseEvent*); int prompt(const QString &, QMessageBox::StandardButton = QMessageBox::Yes); bool promptSaveChanges(); bool promptRestoreDefaults(); void setBorderMetatilesUi(bool customSize); void setBorderMetatileIds(bool customSize, QList metatileIds); QList getBorderMetatileIds(bool customSize); void createProjectPathsTable(); QString chooseProjectFile(const QString &defaultFilepath); void choosePrefabsFile(); void chooseImageFile(QLineEdit * filepathEdit); void chooseFile(QLineEdit * filepathEdit, const QString &description, const QString &extensions); QString stripProjectDir(QString s); void disableParsedSetting(QWidget * widget, const QString &name, const QString &filepath); void updateMaskOverlapWarning(QLabel * warning, QList masks); QStringList getWarpBehaviorsList(); void setWarpBehaviorsList(QStringList list); private slots: void dialogButtonClicked(QAbstractButton *button); void importDefaultPrefabsClicked(bool); void updateAttributeLimits(const QString &attrSize); void updatePokemonIconPath(const QString &species); void markEdited(); void on_mainTabs_tabBarClicked(int index); void updateBlockMaskOverlapWarning(); void updateAttributeMaskOverlapWarning(); void updateWarpBehaviorsList(bool adding); }; #endif // PROJECTSETTINGSEDITOR_H