Remove config diff noise from hashed containers changing order
This commit is contained in:
parent
9efbe53238
commit
3ca1ee1650
4 changed files with 13 additions and 13 deletions
|
@ -337,7 +337,7 @@ public:
|
||||||
QString getEventIconPath(Event::Group group);
|
QString getEventIconPath(Event::Group group);
|
||||||
void setPokemonIconPath(const QString &species, const QString &path);
|
void setPokemonIconPath(const QString &species, const QString &path);
|
||||||
QString getPokemonIconPath(const QString &species);
|
QString getPokemonIconPath(const QString &species);
|
||||||
QHash<QString, QString> getPokemonIconPaths();
|
QMap<QString, QString> getPokemonIconPaths();
|
||||||
|
|
||||||
BaseGameVersion baseGameVersion;
|
BaseGameVersion baseGameVersion;
|
||||||
QString projectDir;
|
QString projectDir;
|
||||||
|
@ -374,7 +374,7 @@ public:
|
||||||
QString collisionSheetPath;
|
QString collisionSheetPath;
|
||||||
int collisionSheetWidth;
|
int collisionSheetWidth;
|
||||||
int collisionSheetHeight;
|
int collisionSheetHeight;
|
||||||
QSet<uint32_t> warpBehaviors;
|
QList<uint32_t> warpBehaviors;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual QString getConfigFilepath() override;
|
virtual QString getConfigFilepath() override;
|
||||||
|
@ -388,7 +388,7 @@ private:
|
||||||
QMap<ProjectIdentifier, QString> identifiers;
|
QMap<ProjectIdentifier, QString> identifiers;
|
||||||
QMap<ProjectFilePath, QString> filePaths;
|
QMap<ProjectFilePath, QString> filePaths;
|
||||||
QMap<Event::Group, QString> eventIconPaths;
|
QMap<Event::Group, QString> eventIconPaths;
|
||||||
QHash<QString, QString> pokemonIconPaths;
|
QMap<QString, QString> pokemonIconPaths;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ProjectConfig projectConfig;
|
extern ProjectConfig projectConfig;
|
||||||
|
|
|
@ -36,7 +36,7 @@ private:
|
||||||
bool projectNeedsReload = false;
|
bool projectNeedsReload = false;
|
||||||
bool refreshing = false;
|
bool refreshing = false;
|
||||||
const QString baseDir;
|
const QString baseDir;
|
||||||
QHash<QString, QString> editedPokemonIconPaths;
|
QMap<QString, QString> editedPokemonIconPaths;
|
||||||
QString prevIconSpecies;
|
QString prevIconSpecies;
|
||||||
|
|
||||||
void initUi();
|
void initUi();
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QAbstractButton>
|
#include <QAbstractButton>
|
||||||
|
|
||||||
const QSet<uint32_t> defaultWarpBehaviors_RSE = {
|
const QList<uint32_t> defaultWarpBehaviors_RSE = {
|
||||||
0x0E, // MB_MOSSDEEP_GYM_WARP
|
0x0E, // MB_MOSSDEEP_GYM_WARP
|
||||||
0x0F, // MB_MT_PYRE_HOLE
|
0x0F, // MB_MT_PYRE_HOLE
|
||||||
0x1B, // MB_STAIRS_OUTSIDE_ABANDONED_SHIP
|
0x1B, // MB_STAIRS_OUTSIDE_ABANDONED_SHIP
|
||||||
|
@ -47,7 +47,7 @@ const QSet<uint32_t> defaultWarpBehaviors_RSE = {
|
||||||
0x9D, // MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN
|
0x9D, // MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN
|
||||||
};
|
};
|
||||||
|
|
||||||
const QSet<uint32_t> defaultWarpBehaviors_FRLG = {
|
const QList<uint32_t> defaultWarpBehaviors_FRLG = {
|
||||||
0x60, // MB_CAVE_DOOR
|
0x60, // MB_CAVE_DOOR
|
||||||
0x61, // MB_LADDER
|
0x61, // MB_LADDER
|
||||||
0x62, // MB_EAST_ARROW_WARP
|
0x62, // MB_EAST_ARROW_WARP
|
||||||
|
@ -773,9 +773,9 @@ void ProjectConfig::parseConfigKeyValue(QString key, QString value) {
|
||||||
} else if (key == "warp_behaviors") {
|
} else if (key == "warp_behaviors") {
|
||||||
this->warpBehaviors.clear();
|
this->warpBehaviors.clear();
|
||||||
value.remove(" ");
|
value.remove(" ");
|
||||||
QStringList behaviorList = value.split(",", Qt::SkipEmptyParts);
|
const QStringList behaviorList = value.split(",", Qt::SkipEmptyParts);
|
||||||
for (auto s : behaviorList)
|
for (auto s : behaviorList)
|
||||||
this->warpBehaviors.insert(getConfigUint32(key, s));
|
this->warpBehaviors.append(getConfigUint32(key, s));
|
||||||
} else {
|
} else {
|
||||||
logWarn(QString("Invalid config key found in config file %1: '%2'").arg(this->getConfigFilepath()).arg(key));
|
logWarn(QString("Invalid config key found in config file %1: '%2'").arg(this->getConfigFilepath()).arg(key));
|
||||||
}
|
}
|
||||||
|
@ -864,7 +864,7 @@ QMap<QString, QString> ProjectConfig::getKeyValueMap() {
|
||||||
map.insert("collision_sheet_width", QString::number(this->collisionSheetWidth));
|
map.insert("collision_sheet_width", QString::number(this->collisionSheetWidth));
|
||||||
map.insert("collision_sheet_height", QString::number(this->collisionSheetHeight));
|
map.insert("collision_sheet_height", QString::number(this->collisionSheetHeight));
|
||||||
QStringList warpBehaviorStrs;
|
QStringList warpBehaviorStrs;
|
||||||
for (auto value : this->warpBehaviors)
|
for (const auto &value : this->warpBehaviors)
|
||||||
warpBehaviorStrs.append("0x" + QString("%1").arg(value, 2, 16, QChar('0')).toUpper());
|
warpBehaviorStrs.append("0x" + QString("%1").arg(value, 2, 16, QChar('0')).toUpper());
|
||||||
map.insert("warp_behaviors", warpBehaviorStrs.join(","));
|
map.insert("warp_behaviors", warpBehaviorStrs.join(","));
|
||||||
|
|
||||||
|
@ -1006,7 +1006,7 @@ QString ProjectConfig::getPokemonIconPath(const QString &species) {
|
||||||
return this->pokemonIconPaths.value(species);
|
return this->pokemonIconPaths.value(species);
|
||||||
}
|
}
|
||||||
|
|
||||||
QHash<QString, QString> ProjectConfig::getPokemonIconPaths() {
|
QMap<QString, QString> ProjectConfig::getPokemonIconPaths() {
|
||||||
return this->pokemonIconPaths;
|
return this->pokemonIconPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -475,7 +475,7 @@ void ProjectSettingsEditor::refresh() {
|
||||||
|
|
||||||
// Set warp behaviors
|
// Set warp behaviors
|
||||||
QStringList behaviorNames;
|
QStringList behaviorNames;
|
||||||
for (auto value : projectConfig.warpBehaviors) {
|
for (const auto &value : projectConfig.warpBehaviors) {
|
||||||
if (project->metatileBehaviorMapInverse.contains(value))
|
if (project->metatileBehaviorMapInverse.contains(value))
|
||||||
behaviorNames.append(project->metatileBehaviorMapInverse.value(value));
|
behaviorNames.append(project->metatileBehaviorMapInverse.value(value));
|
||||||
}
|
}
|
||||||
|
@ -541,9 +541,9 @@ void ProjectSettingsEditor::save() {
|
||||||
|
|
||||||
// Save warp behaviors
|
// Save warp behaviors
|
||||||
projectConfig.warpBehaviors.clear();
|
projectConfig.warpBehaviors.clear();
|
||||||
QStringList behaviorNames = this->getWarpBehaviorsList();
|
const QStringList behaviorNames = this->getWarpBehaviorsList();
|
||||||
for (auto name : behaviorNames)
|
for (auto name : behaviorNames)
|
||||||
projectConfig.warpBehaviors.insert(project->metatileBehaviorMap.value(name));
|
projectConfig.warpBehaviors.append(project->metatileBehaviorMap.value(name));
|
||||||
|
|
||||||
// Save border metatile IDs
|
// Save border metatile IDs
|
||||||
projectConfig.newMapBorderMetatileIds = this->getBorderMetatileIds(ui->checkBox_EnableCustomBorderSize->isChecked());
|
projectConfig.newMapBorderMetatileIds = this->getBorderMetatileIds(ui->checkBox_EnableCustomBorderSize->isChecked());
|
||||||
|
|
Loading…
Reference in a new issue