Merge branch 'dev' of https://github.com/huderlem/porymap into utility

This commit is contained in:
GriffinR
2025-02-26 16:05:04 -05:00
34 changed files with 1139 additions and 1041 deletions

View File

@@ -147,13 +147,12 @@ QStringList Map::getScriptLabels(Event::Group group) {
scriptLabels = scriptTracker.getScripts();
}
// Add scripts from map's scripts file, and empty names.
// Add labels from the map's scripts file
scriptLabels.append(m_scriptsFileLabels);
scriptLabels.sort(Qt::CaseInsensitive);
scriptLabels.prepend("0x0");
scriptLabels.prepend("NULL");
scriptLabels.removeAll("");
scriptLabels.removeAll("0");
scriptLabels.removeAll("0x0");
scriptLabels.removeDuplicates();
return scriptLabels;
@@ -164,7 +163,7 @@ QString Map::getScriptsFilePath() const {
auto path = QDir::cleanPath(QString("%1/%2/%3/scripts")
.arg(projectConfig.projectDir)
.arg(projectConfig.getFilePath(ProjectFilePath::data_map_folders))
.arg(m_name));
.arg(!m_sharedScriptsMap.isEmpty() ? m_sharedScriptsMap : m_name));
auto extension = Project::getScriptFileExtension(usePoryscript);
if (usePoryscript && !QFile::exists(path + extension))
extension = Project::getScriptFileExtension(false);
@@ -224,6 +223,10 @@ int Map::getIndexOfEvent(Event *event) const {
return m_events.value(event->getEventGroup()).indexOf(event);
}
bool Map::hasEvent(Event *event) const {
return getIndexOfEvent(event) >= 0;
}
void Map::deleteConnections() {
qDeleteAll(m_ownedConnections);
m_ownedConnections.clear();