mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-16 13:48:01 -05:00
Remove Project::topLevelMapFields
This commit is contained in:
@@ -71,7 +71,6 @@ public:
|
||||
QSet<QString> modifiedFiles;
|
||||
bool usingAsmTilesets;
|
||||
QSet<QString> disabledSettingsNames;
|
||||
QSet<QString> topLevelMapFields;
|
||||
int pokemonMinLevel;
|
||||
int pokemonMaxLevel;
|
||||
int maxEncounterRate;
|
||||
@@ -161,7 +160,6 @@ public:
|
||||
bool hasUnsavedChanges();
|
||||
bool hasUnsavedDataChanges = false;
|
||||
|
||||
void initTopLevelMapFields();
|
||||
bool readMapJson(const QString &mapName, QJsonDocument * out);
|
||||
bool loadMapEvent(Map *map, QJsonObject json, Event::Type defaultType = Event::Type::None);
|
||||
bool loadMapData(Map*);
|
||||
@@ -241,6 +239,8 @@ public:
|
||||
void setRegionMapEntries(const QHash<QString, MapSectionEntry> &entries);
|
||||
QHash<QString, MapSectionEntry> getRegionMapEntries() const;
|
||||
|
||||
QSet<QString> getTopLevelMapFields() const;
|
||||
|
||||
static QString getEmptyMapDefineName();
|
||||
static QString getDynamicMapDefineName();
|
||||
static QString getDynamicMapName();
|
||||
|
||||
@@ -1192,7 +1192,7 @@ bool MainWindow::setProjectUI() {
|
||||
ui->layoutList->setModel(layoutListProxyModel);
|
||||
ui->layoutList->sortByColumn(0, Qt::SortOrder::AscendingOrder);
|
||||
|
||||
ui->mapCustomAttributesFrame->table()->setRestrictedKeys(project->topLevelMapFields);
|
||||
ui->mapCustomAttributesFrame->table()->setRestrictedKeys(project->getTopLevelMapFields());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -177,8 +177,8 @@ Map* Project::loadMap(const QString &mapName) {
|
||||
return map;
|
||||
}
|
||||
|
||||
void Project::initTopLevelMapFields() {
|
||||
static const QSet<QString> defaultTopLevelMapFields = {
|
||||
QSet<QString> Project::getTopLevelMapFields() const {
|
||||
QSet<QString> fields = {
|
||||
"id",
|
||||
"name",
|
||||
"layout",
|
||||
@@ -197,15 +197,15 @@ void Project::initTopLevelMapFields() {
|
||||
"shared_events_map",
|
||||
"shared_scripts_map",
|
||||
};
|
||||
this->topLevelMapFields = defaultTopLevelMapFields;
|
||||
if (projectConfig.mapAllowFlagsEnabled) {
|
||||
this->topLevelMapFields.insert("allow_cycling");
|
||||
this->topLevelMapFields.insert("allow_escaping");
|
||||
this->topLevelMapFields.insert("allow_running");
|
||||
fields.insert("allow_cycling");
|
||||
fields.insert("allow_escaping");
|
||||
fields.insert("allow_running");
|
||||
}
|
||||
if (projectConfig.floorNumberEnabled) {
|
||||
this->topLevelMapFields.insert("floor_number");
|
||||
fields.insert("floor_number");
|
||||
}
|
||||
return fields;
|
||||
}
|
||||
|
||||
bool Project::readMapJson(const QString &mapName, QJsonDocument * out) {
|
||||
@@ -1794,8 +1794,6 @@ bool Project::readMapGroups() {
|
||||
this->groupNameToMapNames.clear();
|
||||
this->customMapGroupsData = QJsonObject();
|
||||
|
||||
this->initTopLevelMapFields();
|
||||
|
||||
const QString filepath = projectConfig.getFilePath(ProjectFilePath::json_map_groups);
|
||||
fileWatcher.addPath(root + "/" + filepath);
|
||||
QJsonDocument mapGroupsDoc;
|
||||
|
||||
Reference in New Issue
Block a user