Restore Project::defaultSong
This commit is contained in:
parent
3ebc7a93d4
commit
42a95b32a2
3 changed files with 4 additions and 1 deletions
|
@ -54,6 +54,7 @@ public:
|
||||||
QMap<int, QString> mapSectionValueToName;
|
QMap<int, QString> mapSectionValueToName;
|
||||||
QMap<QString, EventGraphics*> eventGraphicsMap;
|
QMap<QString, EventGraphics*> eventGraphicsMap;
|
||||||
QMap<QString, int> gfxDefines;
|
QMap<QString, int> gfxDefines;
|
||||||
|
QString defaultSong;
|
||||||
QStringList songNames;
|
QStringList songNames;
|
||||||
QStringList itemNames;
|
QStringList itemNames;
|
||||||
QStringList flagNames;
|
QStringList flagNames;
|
||||||
|
|
|
@ -2339,6 +2339,8 @@ bool Project::readSongNames() {
|
||||||
logWarn(QString("Failed to read song names from %1.").arg(filename));
|
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.
|
// 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();
|
this->songNames.sort();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ void NewMapPopup::setDefaultSettings(Project *project) {
|
||||||
settings.secondaryTilesetLabel = project->getDefaultSecondaryTilesetLabel();
|
settings.secondaryTilesetLabel = project->getDefaultSecondaryTilesetLabel();
|
||||||
settings.type = project->mapTypes.value(0, "0");
|
settings.type = project->mapTypes.value(0, "0");
|
||||||
settings.location = project->mapSectionNameToValue.keys().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.canFlyTo = false;
|
||||||
settings.showLocationName = true;
|
settings.showLocationName = true;
|
||||||
settings.allowRunning = false;
|
settings.allowRunning = false;
|
||||||
|
|
Loading…
Reference in a new issue