mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-23 17:16:17 -05:00
Add global constants settings
This commit is contained in:
@@ -346,6 +346,7 @@ public:
|
||||
this->unusedTileSplit = 0x0000;
|
||||
this->maxEventsPerGroup = 255;
|
||||
this->globalConstantsFilepaths.clear();
|
||||
this->globalConstants.clear();
|
||||
this->identifiers.clear();
|
||||
this->readKeys.clear();
|
||||
}
|
||||
@@ -419,6 +420,7 @@ public:
|
||||
QList<uint32_t> warpBehaviors;
|
||||
int maxEventsPerGroup;
|
||||
QStringList globalConstantsFilepaths;
|
||||
QMap<QString,QString> globalConstants;
|
||||
|
||||
protected:
|
||||
virtual QString getConfigFilepath() override;
|
||||
|
||||
@@ -58,7 +58,8 @@ public:
|
||||
QMap<QString, int> readCDefinesByRegex(const QString &filename, const QSet<QString> ®exList, QString *error = nullptr);
|
||||
QMap<QString, int> readCDefinesByName(const QString &filename, const QSet<QString> &names, QString *error = nullptr);
|
||||
QStringList readCDefineNames(const QString &filename, const QSet<QString> ®exList, QString *error = nullptr);
|
||||
void loadGlobalCDefines(const QString &filename, QString *error = nullptr);
|
||||
void loadGlobalCDefinesFromFile(const QString &filename, QString *error = nullptr);
|
||||
void loadGlobalCDefines(const QMap<QString,QString> &defines);
|
||||
void resetGlobalCDefines();
|
||||
OrderedMap<QString, QHash<QString, QString>> readCStructs(const QString &, const QString & = "", const QHash<int, QString>& = {});
|
||||
QList<QStringList> getLabelMacros(const QList<QStringList>&, const QString&);
|
||||
|
||||
32
include/ui/newdefinedialog.h
Normal file
32
include/ui/newdefinedialog.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef NEWDEFINEDIALOG_H
|
||||
#define NEWDEFINEDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QAbstractButton>
|
||||
|
||||
namespace Ui {
|
||||
class NewDefineDialog;
|
||||
}
|
||||
|
||||
class NewDefineDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit NewDefineDialog(QWidget *parent = nullptr);
|
||||
~NewDefineDialog();
|
||||
|
||||
virtual void accept() override;
|
||||
|
||||
signals:
|
||||
void createdDefine(const QString &name, const QString &expression);
|
||||
|
||||
private:
|
||||
Ui::NewDefineDialog *ui;
|
||||
|
||||
bool validateName(bool allowEmpty = false);
|
||||
void onNameChanged(const QString &name);
|
||||
void dialogButtonClicked(QAbstractButton *button);
|
||||
};
|
||||
|
||||
#endif // NEWDEFINEDIALOG_H
|
||||
@@ -67,6 +67,12 @@ private:
|
||||
void setWarpBehaviorsList(QStringList list);
|
||||
void openFilesHelp();
|
||||
void openIdentifiersHelp();
|
||||
void addNewGlobalConstantsFilepath();
|
||||
void addGlobalConstantsFilepath(const QString &filepath);
|
||||
QStringList getGlobalConstantsFilepaths();
|
||||
void addNewGlobalConstant();
|
||||
void addGlobalConstant(const QString &name, const QString &expression);
|
||||
QMap<QString,QString> getGlobalConstants();
|
||||
|
||||
private slots:
|
||||
void dialogButtonClicked(QAbstractButton *button);
|
||||
|
||||
Reference in New Issue
Block a user