Remove config diff noise from hashed containers changing order

This commit is contained in:
GriffinR 2024-12-28 00:56:34 -05:00
parent 9efbe53238
commit 3ca1ee1650
4 changed files with 13 additions and 13 deletions

View file

@ -337,7 +337,7 @@ public:
QString getEventIconPath(Event::Group group);
void setPokemonIconPath(const QString &species, const QString &path);
QString getPokemonIconPath(const QString &species);
QHash<QString, QString> getPokemonIconPaths();
QMap<QString, QString> getPokemonIconPaths();
BaseGameVersion baseGameVersion;
QString projectDir;
@ -374,7 +374,7 @@ public:
QString collisionSheetPath;
int collisionSheetWidth;
int collisionSheetHeight;
QSet<uint32_t> warpBehaviors;
QList<uint32_t> warpBehaviors;
protected:
virtual QString getConfigFilepath() override;
@ -388,7 +388,7 @@ private:
QMap<ProjectIdentifier, QString> identifiers;
QMap<ProjectFilePath, QString> filePaths;
QMap<Event::Group, QString> eventIconPaths;
QHash<QString, QString> pokemonIconPaths;
QMap<QString, QString> pokemonIconPaths;
};
extern ProjectConfig projectConfig;

View file

@ -36,7 +36,7 @@ private:
bool projectNeedsReload = false;
bool refreshing = false;
const QString baseDir;
QHash<QString, QString> editedPokemonIconPaths;
QMap<QString, QString> editedPokemonIconPaths;
QString prevIconSpecies;
void initUi();

View file

@ -16,7 +16,7 @@
#include <QAction>
#include <QAbstractButton>
const QSet<uint32_t> defaultWarpBehaviors_RSE = {
const QList<uint32_t> defaultWarpBehaviors_RSE = {
0x0E, // MB_MOSSDEEP_GYM_WARP
0x0F, // MB_MT_PYRE_HOLE
0x1B, // MB_STAIRS_OUTSIDE_ABANDONED_SHIP
@ -47,7 +47,7 @@ const QSet<uint32_t> defaultWarpBehaviors_RSE = {
0x9D, // MB_SECRET_BASE_SPOT_TREE_RIGHT_OPEN
};
const QSet<uint32_t> defaultWarpBehaviors_FRLG = {
const QList<uint32_t> defaultWarpBehaviors_FRLG = {
0x60, // MB_CAVE_DOOR
0x61, // MB_LADDER
0x62, // MB_EAST_ARROW_WARP
@ -773,9 +773,9 @@ void ProjectConfig::parseConfigKeyValue(QString key, QString value) {
} else if (key == "warp_behaviors") {
this->warpBehaviors.clear();
value.remove(" ");
QStringList behaviorList = value.split(",", Qt::SkipEmptyParts);
const QStringList behaviorList = value.split(",", Qt::SkipEmptyParts);
for (auto s : behaviorList)
this->warpBehaviors.insert(getConfigUint32(key, s));
this->warpBehaviors.append(getConfigUint32(key, s));
} else {
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_height", QString::number(this->collisionSheetHeight));
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());
map.insert("warp_behaviors", warpBehaviorStrs.join(","));
@ -1006,7 +1006,7 @@ QString ProjectConfig::getPokemonIconPath(const QString &species) {
return this->pokemonIconPaths.value(species);
}
QHash<QString, QString> ProjectConfig::getPokemonIconPaths() {
QMap<QString, QString> ProjectConfig::getPokemonIconPaths() {
return this->pokemonIconPaths;
}

View file

@ -475,7 +475,7 @@ void ProjectSettingsEditor::refresh() {
// Set warp behaviors
QStringList behaviorNames;
for (auto value : projectConfig.warpBehaviors) {
for (const auto &value : projectConfig.warpBehaviors) {
if (project->metatileBehaviorMapInverse.contains(value))
behaviorNames.append(project->metatileBehaviorMapInverse.value(value));
}
@ -541,9 +541,9 @@ void ProjectSettingsEditor::save() {
// Save warp behaviors
projectConfig.warpBehaviors.clear();
QStringList behaviorNames = this->getWarpBehaviorsList();
const QStringList behaviorNames = this->getWarpBehaviorsList();
for (auto name : behaviorNames)
projectConfig.warpBehaviors.insert(project->metatileBehaviorMap.value(name));
projectConfig.warpBehaviors.append(project->metatileBehaviorMap.value(name));
// Save border metatile IDs
projectConfig.newMapBorderMetatileIds = this->getBorderMetatileIds(ui->checkBox_EnableCustomBorderSize->isChecked());