mirror of
https://github.com/huderlem/porymap.git
synced 2026-03-21 17:45:44 -05:00
Use map group order for initial map
This commit is contained in:
parent
d14cca6891
commit
156546def6
|
|
@ -73,6 +73,7 @@ public:
|
|||
void setRoot(const QString&);
|
||||
|
||||
const QStringList& mapNames() const { return this->alphabeticalMapNames; }
|
||||
QStringList getMapNamesByGroup() const;
|
||||
bool isKnownMap(const QString &mapName) const { return this->maps.contains(mapName); }
|
||||
bool isErroredMap(const QString &mapName) const { return this->erroredMaps.contains(mapName); }
|
||||
bool isLoadedMap(const QString &mapName) const { return this->loadedMapNames.contains(mapName); }
|
||||
|
|
|
|||
|
|
@ -878,7 +878,7 @@ bool MainWindow::setInitialMap() {
|
|||
}
|
||||
|
||||
// Failed to open recent map/layout, or no recent map/layout. Try opening maps then layouts sequentially.
|
||||
for (const auto &name : editor->project->mapNames()) {
|
||||
for (const auto &name : editor->project->getMapNamesByGroup()) {
|
||||
if (name != recent && setMap(name))
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2017,6 +2017,16 @@ QStringList Project::getLayoutNames() const {
|
|||
return names;
|
||||
}
|
||||
|
||||
QStringList Project::getMapNamesByGroup() const {
|
||||
QStringList names;
|
||||
for (const auto &groupName : this->groupNames) {
|
||||
for (const auto &groupMapNames : this->groupNameToMapNames.value(groupName)) {
|
||||
names.append(groupMapNames);
|
||||
}
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
bool Project::isUnsavedMap(const QString &mapName) const {
|
||||
Map* map = this->maps.value(mapName);
|
||||
return map ? map->hasUnsavedChanges() : false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user