mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-08 17:05:43 -05:00
Restore Project::defaultSong
This commit is contained in:
@@ -54,6 +54,7 @@ public:
|
||||
QMap<int, QString> mapSectionValueToName;
|
||||
QMap<QString, EventGraphics*> eventGraphicsMap;
|
||||
QMap<QString, int> gfxDefines;
|
||||
QString defaultSong;
|
||||
QStringList songNames;
|
||||
QStringList itemNames;
|
||||
QStringList flagNames;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user