2023-08-23 07:32:32 +01:00
|
|
|
#ifndef PROJECTSETTINGSEDITOR_H
|
|
|
|
#define PROJECTSETTINGSEDITOR_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include "project.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();
|
|
|
|
|
|
|
|
signals:
|
2023-08-29 02:02:52 +01:00
|
|
|
void reloadProject();
|
2023-08-23 07:32:32 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::ProjectSettingsEditor *ui;
|
|
|
|
Project *project;
|
|
|
|
|
2023-08-24 02:07:13 +01:00
|
|
|
bool hasUnsavedChanges = false;
|
2023-08-29 02:02:52 +01:00
|
|
|
bool projectNeedsReload = false;
|
|
|
|
bool refreshing = false;
|
2023-09-10 00:36:12 +01:00
|
|
|
const QString baseDir;
|
2023-12-10 08:49:54 +00:00
|
|
|
QHash<QString, QString> editedPokemonIconPaths;
|
|
|
|
QString prevIconSpecies;
|
2023-08-24 02:07:13 +01:00
|
|
|
|
2023-08-23 07:32:32 +01:00
|
|
|
void initUi();
|
2023-08-24 02:07:13 +01:00
|
|
|
void connectSignals();
|
2023-08-29 02:02:52 +01:00
|
|
|
void restoreWindowState();
|
|
|
|
void save();
|
2023-08-24 02:07:13 +01:00
|
|
|
void refresh();
|
2023-08-29 02:02:52 +01:00
|
|
|
void closeEvent(QCloseEvent*);
|
|
|
|
int prompt(const QString &, QMessageBox::StandardButton = QMessageBox::Yes);
|
|
|
|
bool promptSaveChanges();
|
|
|
|
bool promptRestoreDefaults();
|
2023-08-23 07:32:32 +01:00
|
|
|
|
2023-09-19 19:21:36 +01:00
|
|
|
void setBorderMetatilesUi(bool customSize);
|
|
|
|
void setBorderMetatileIds(bool customSize, QList<uint16_t> metatileIds);
|
|
|
|
QList<uint16_t> getBorderMetatileIds(bool customSize);
|
|
|
|
|
2023-09-07 04:33:13 +01:00
|
|
|
void createProjectPathsTable();
|
2023-09-10 00:36:12 +01:00
|
|
|
QString chooseProjectFile(const QString &defaultFilepath);
|
2023-12-08 20:13:21 +00:00
|
|
|
void choosePrefabsFile();
|
|
|
|
void chooseImageFile(QLineEdit * filepathEdit);
|
|
|
|
void chooseFile(QLineEdit * filepathEdit, const QString &description, const QString &extensions);
|
2023-12-10 08:49:54 +00:00
|
|
|
QString stripProjectDir(QString s);
|
2023-09-07 04:33:13 +01:00
|
|
|
|
2023-08-23 07:32:32 +01:00
|
|
|
private slots:
|
|
|
|
void dialogButtonClicked(QAbstractButton *button);
|
2023-08-31 18:47:13 +01:00
|
|
|
void importDefaultPrefabsClicked(bool);
|
2023-09-11 21:32:15 +01:00
|
|
|
void updateAttributeLimits(const QString &attrSize);
|
2023-12-10 08:49:54 +00:00
|
|
|
void updatePokemonIconPath(const QString &species);
|
2023-08-24 02:07:13 +01:00
|
|
|
void markEdited();
|
2023-12-08 20:13:21 +00:00
|
|
|
void on_mainTabs_tabBarClicked(int index);
|
2023-08-23 07:32:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PROJECTSETTINGSEDITOR_H
|