porymap/include/ui/projectsettingseditor.h

79 lines
2.3 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"
2023-12-16 08:36:26 +00:00
#include "ui_projectsettingseditor.h"
2023-08-23 07:32:32 +01:00
class NoScrollComboBox;
class QAbstractButton;
namespace Ui {
class ProjectSettingsEditor;
}
class ProjectSettingsEditor : public QMainWindow
{
Q_OBJECT
public:
explicit ProjectSettingsEditor(QWidget *parent = nullptr, Project *project = nullptr);
~ProjectSettingsEditor();
2023-12-17 01:35:54 +00:00
static const int eventsTab;
2023-11-07 17:35:31 +00:00
void setTab(int index);
2023-08-23 07:32:32 +01:00
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);
void disableParsedSetting(QWidget * widget, const QString &name, const QString &filepath);
2023-12-16 08:36:26 +00:00
void updateMaskOverlapWarning(QLabel * warning, QList<UIntSpinBox*> masks);
2023-12-17 01:35:54 +00:00
QStringList getWarpBehaviorsList();
void setWarpBehaviorsList(QStringList list);
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-12-16 08:36:26 +00:00
void updateBlockMaskOverlapWarning();
void updateAttributeMaskOverlapWarning();
2023-12-17 01:35:54 +00:00
void updateWarpBehaviorsList(bool adding);
2023-08-23 07:32:32 +01:00
};
#endif // PROJECTSETTINGSEDITOR_H