Merge branch 'master' of https://github.com/huderlem/porymap into slam

This commit is contained in:
garak
2024-02-22 16:20:23 -05:00
50 changed files with 2647 additions and 1554 deletions

View File

@@ -27,7 +27,7 @@ Map::~Map() {
void Map::setName(QString mapName) {
name = mapName;
constantName = mapConstantFromName(mapName);
scriptsFileLabels = ParseUtil::getGlobalScriptLabels(this->getScriptsFilePath());
scriptsLoaded = false;
}
void Map::setLayout(Layout *layout) {
@@ -117,7 +117,12 @@ QList<Event *> Map::getAllEvents() const {
return all_events;
}
QStringList Map::getScriptLabels(Event::Group group) const {
QStringList Map::getScriptLabels(Event::Group group) {
if (!this->scriptsLoaded) {
this->scriptsFileLabels = ParseUtil::getGlobalScriptLabels(this->getScriptsFilePath());
this->scriptsLoaded = true;
}
QStringList scriptLabels;
// Get script labels currently in-use by the map's events
@@ -136,7 +141,7 @@ QStringList Map::getScriptLabels(Event::Group group) const {
}
// Add scripts from map's scripts file, and empty names.
scriptLabels.append(scriptsFileLabels);
scriptLabels.append(this->scriptsFileLabels);
scriptLabels.sort(Qt::CaseInsensitive);
scriptLabels.prepend("0x0");
scriptLabels.prepend("NULL");