diff --git a/.gitignore b/.gitignore index 9157e62c..08388497 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,11 @@ porymap.app* porymap porymap.cfg porymap.log +build/ # Qt generated files ui_*.h moc_*.h moc_*.cpp qrc_*.cpp +.qtc_clangd diff --git a/CHANGELOG.md b/CHANGELOG.md index f5e33e44..2e80de0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Add a `Close Project` option - Add charts to the `Wild Pokémon` tab that show species and level distributions. - An alert will be displayed when attempting to open a seemingly invalid project. +- Add support for defining project values with `enum` where `#define` was expected. ### Changed - Edits to map connections now have Undo/Redo and can be viewed in exported timelapses. @@ -43,6 +44,8 @@ The **"Breaking Changes"** listed below are changes that have been made in the d - Fix map connections rendering incorrectly if their dimensions were smaller than the border draw distance. - Fix the map list filter retaining text between project open/close. - Fix the map list mishandling value gaps when sorting by Area. +- Fix a freeze on startup if project values are defined with mismatched parentheses. +- Fix stitched map images sometimes rendering garbage ## [5.4.1] - 2024-03-21 ### Fixed diff --git a/INSTALL.md b/INSTALL.md index 34f03196..6c26b59a 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -39,3 +39,14 @@ qmake make ./porymap ``` + +## Arch Linux + +You need to install Qt. You can check the version of your Qt packages with `qtdiag` or `qmake --version`. + +```bash +sudo pacman -S qt6-declarative qt6-charts +qmake +make +./porymap +``` diff --git a/include/core/events.h b/include/core/events.h index 2e00ef72..c0a5a625 100644 --- a/include/core/events.h +++ b/include/core/events.h @@ -187,6 +187,7 @@ public: static QString eventGroupToString(Event::Group group); static QString eventTypeToString(Event::Type type); static Event::Type eventTypeFromString(QString type); + static void clearIcons(); static void setIcons(); // protected attributes diff --git a/include/core/parseutil.h b/include/core/parseutil.h index 9e00087e..e3df8375 100644 --- a/include/core/parseutil.h +++ b/include/core/parseutil.h @@ -54,9 +54,9 @@ public: QString readCIncbin(const QString &text, const QString &label); QMap readCIncbinMulti(const QString &filepath); QStringList readCIncbinArray(const QString &filename, const QString &label); - QMap readCDefinesByPrefix(const QString &filename, QStringList prefixes); - QMap readCDefinesByName(const QString &filename, QStringList names); - QStringList readCDefineNames(const QString&, const QStringList&); + QMap readCDefinesByRegex(const QString &filename, const QStringList ®exList); + QMap readCDefinesByName(const QString &filename, const QStringList &names); + QStringList readCDefineNames(const QString &filename, const QStringList ®exList); QMap> readCStructs(const QString &, const QString & = "", const QHash = { }); QList getLabelMacros(const QList&, const QString&); QStringList getLabelValues(const QList&, const QString&); @@ -97,8 +97,15 @@ private: void recordErrors(const QStringList &errors); void logRecordedErrors(); QString createErrorMessage(const QString &message, const QString &expression); - QString readCDefinesFile(const QString &filename); - QMap readCDefines(const QString &filename, const QStringList &searchText, bool fullMatch); + + struct ParsedDefines { + QMap expressions; // Map of all define names encountered to their expressions + QStringList filteredNames; // List of define names that matched the search text, in the order that they were encountered + }; + ParsedDefines readCDefines(const QString &filename, const QStringList &filterList, bool useRegex); + QMap evaluateCDefines(const QString &filename, const QStringList &filterList, bool useRegex); + bool defineNameMatchesFilter(const QString &name, const QStringList &filterList) const; + bool defineNameMatchesFilter(const QString &name, const QList &filterList) const; static const QRegularExpression re_incScriptLabel; static const QRegularExpression re_globalIncScriptLabel; diff --git a/include/project.h b/include/project.h index e5deb75e..8d6ce9e1 100644 --- a/include/project.h +++ b/include/project.h @@ -93,7 +93,8 @@ public: void clearMapCache(); void clearTilesetCache(); - void clearLayoutsTable(); + void clearMapLayouts(); + void clearEventGraphics(); struct DataQualifiers { diff --git a/include/ui/updatepromoter.h b/include/ui/updatepromoter.h index 8b67c69e..de73bcdd 100644 --- a/include/ui/updatepromoter.h +++ b/include/ui/updatepromoter.h @@ -17,7 +17,7 @@ class UpdatePromoter : public QDialog public: explicit UpdatePromoter(QWidget *parent, NetworkAccessManager *manager); - ~UpdatePromoter() {}; + ~UpdatePromoter(); void checkForUpdates(); void updatePreferences(); diff --git a/src/config.cpp b/src/config.cpp index a1029b92..ef543327 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -208,7 +208,6 @@ void KeyValueConfigBase::load() { } QTextStream in(&file); - QList configLines; static const QRegularExpression re("^(?[^=]+)=(?.*)$"); while (!in.atEnd()) { QString line = in.readLine().trimmed(); @@ -1063,7 +1062,6 @@ QMap UserConfig::getKeyValueMap() { } void UserConfig::init() { - QString dirName = QDir(this->projectDir).dirName().toLower(); this->useEncounterJson = true; this->customScripts.clear(); } diff --git a/src/core/events.cpp b/src/core/events.cpp index 13be4153..89416eae 100644 --- a/src/core/events.cpp +++ b/src/core/events.cpp @@ -146,10 +146,13 @@ void Event::loadPixmap(Project *) { this->pixmap = pixmap ? *pixmap : QPixmap(); } -void Event::setIcons() { +void Event::clearIcons() { qDeleteAll(icons); icons.clear(); +} +void Event::setIcons() { + clearIcons(); const int w = 16; const int h = 16; static const QPixmap defaultIcons = QPixmap(":/images/Entities_16x16.png"); diff --git a/src/core/parseutil.cpp b/src/core/parseutil.cpp index c5d09635..9664fdc7 100644 --- a/src/core/parseutil.cpp +++ b/src/core/parseutil.cpp @@ -15,6 +15,22 @@ const QRegularExpression ParseUtil::re_poryScriptLabel("\\b(script)(\\((global|l const QRegularExpression ParseUtil::re_globalPoryScriptLabel("\\b(script)(\\((global)\\))?\\s*\\b(?