mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-14 04:46:49 -05:00
Merge remote-tracking branch 'origin/master' into fix827
# Conflicts: # src/mainwindow.cpp
This commit is contained in:
@@ -32,10 +32,10 @@ public:
|
||||
Event(const Event&);
|
||||
Event(QJsonObject, QString);
|
||||
public:
|
||||
int x() {
|
||||
int x() const {
|
||||
return getInt("x");
|
||||
}
|
||||
int y() {
|
||||
int y() const {
|
||||
return getInt("y");
|
||||
}
|
||||
int elevation() {
|
||||
@@ -47,16 +47,16 @@ public:
|
||||
void setY(int y) {
|
||||
put("y", y);
|
||||
}
|
||||
QString get(QString key) {
|
||||
QString get(const QString &key) const {
|
||||
return values.value(key);
|
||||
}
|
||||
int getInt(QString key) {
|
||||
int getInt(const QString &key) const {
|
||||
return values.value(key).toInt(nullptr, 0);
|
||||
}
|
||||
uint16_t getU16(QString key) {
|
||||
uint16_t getU16(const QString &key) const {
|
||||
return values.value(key).toUShort(nullptr, 0);
|
||||
}
|
||||
int16_t getS16(QString key) {
|
||||
int16_t getS16(const QString &key) const {
|
||||
return values.value(key).toShort(nullptr, 0);
|
||||
}
|
||||
void put(QString key, int value) {
|
||||
|
||||
@@ -84,7 +84,8 @@ public:
|
||||
void floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
|
||||
void _floodFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
|
||||
void magicFillCollisionElevation(int x, int y, uint16_t collision, uint16_t elevation);
|
||||
QList<Event*> getAllEvents();
|
||||
QList<Event*> getAllEvents() const;
|
||||
QStringList eventScriptLabels(const QString &event_group_type = QString()) const;
|
||||
void removeEvent(Event*);
|
||||
void addEvent(Event*);
|
||||
QPixmap renderConnection(MapConnection, MapLayout *);
|
||||
|
||||
@@ -41,7 +41,7 @@ class ParseUtil
|
||||
public:
|
||||
ParseUtil();
|
||||
void set_root(QString);
|
||||
QString readTextFile(QString);
|
||||
static QString readTextFile(QString);
|
||||
void strip_comment(QString*);
|
||||
QList<QStringList>* parseAsm(QString);
|
||||
int evaluateDefine(QString, QMap<QString, int>*);
|
||||
@@ -55,6 +55,17 @@ public:
|
||||
bool tryParseJsonFile(QJsonDocument *out, QString filepath);
|
||||
bool ensureFieldsExist(QJsonObject obj, QList<QString> fields);
|
||||
|
||||
// Returns the 1-indexed line number for the definition of scriptLabel in the scripts file at filePath.
|
||||
// Returns 0 if a definition for scriptLabel cannot be found.
|
||||
static int getScriptLineNumber(const QString &filePath, const QString &scriptLabel);
|
||||
static int getRawScriptLineNumber(QString text, const QString &scriptLabel);
|
||||
static int getPoryScriptLineNumber(QString text, const QString &scriptLabel);
|
||||
static QString &removeStringLiterals(QString &text);
|
||||
static QString &removeLineComments(QString &text, const QString &commentSymbol);
|
||||
static QString &removeLineComments(QString &text, const QStringList &commentSymbols);
|
||||
|
||||
static QStringList splitShellCommand(QStringView command);
|
||||
|
||||
private:
|
||||
QString root;
|
||||
QString text;
|
||||
|
||||
Reference in New Issue
Block a user