porymap/include/ui/projectsettingseditor.h

68 lines
1.8 KiB
C
Raw Normal View History

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;
bool hasUnsavedChanges = false;
2023-08-29 02:02:52 +01:00
bool projectNeedsReload = false;
bool refreshing = false;
const QString baseDir;
QHash<QString, QString> editedPokemonIconPaths;
QString prevIconSpecies;
2023-08-23 07:32:32 +01:00
void initUi();
void connectSignals();
2023-08-29 02:02:52 +01:00
void restoreWindowState();
void save();
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
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();
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);
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);
void updateAttributeLimits(const QString &attrSize);
void updatePokemonIconPath(const QString &species);
void markEdited();
void on_mainTabs_tabBarClicked(int index);
2023-08-23 07:32:32 +01:00
};
#endif // PROJECTSETTINGSEDITOR_H