diff --git a/include/project.h b/include/project.h index a7c3799d..643f74da 100644 --- a/include/project.h +++ b/include/project.h @@ -54,6 +54,7 @@ public: QMap mapSectionValueToName; QMap eventGraphicsMap; QMap gfxDefines; + QString defaultSong; QStringList songNames; QStringList itemNames; QStringList flagNames; diff --git a/src/project.cpp b/src/project.cpp index fc9b989a..c6550c6a 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -2339,6 +2339,8 @@ bool Project::readSongNames() { logWarn(QString("Failed to read song names from %1.").arg(filename)); // Song names don't have a very useful order (esp. if we include SE_* values), so sort them alphabetically. + // The default song should be the first in the list, not the first alphabetically, so save that before sorting. + this->defaultSong = this->songNames.value(0, "0"); this->songNames.sort(); return true; } diff --git a/src/ui/newmappopup.cpp b/src/ui/newmappopup.cpp index 241d29c3..2c4141bc 100644 --- a/src/ui/newmappopup.cpp +++ b/src/ui/newmappopup.cpp @@ -175,7 +175,7 @@ void NewMapPopup::setDefaultSettings(Project *project) { settings.secondaryTilesetLabel = project->getDefaultSecondaryTilesetLabel(); settings.type = project->mapTypes.value(0, "0"); settings.location = project->mapSectionNameToValue.keys().value(0, "0"); - settings.song = project->songNames.value(0, "0"); + settings.song = project->defaultSong; settings.canFlyTo = false; settings.showLocationName = true; settings.allowRunning = false;