Reduce diff noise when saving maps

This commit is contained in:
GriffinR 2025-02-05 15:59:13 -05:00
parent 52a900b85d
commit be02424f1c
3 changed files with 6 additions and 1 deletions

View File

@ -35,6 +35,7 @@ The **"Breaking Changes"** listed below are changes that have been made in the d
- `Export Map Stitch Image` now shows a preview of the full image, not just the current map.
- Maps and layouts were internally separated.
- Unrecognized map names in Event or Connections data will no longer be overwritten.
- Reduced diff noise when saving maps.
- Map names and ``MAP_NAME`` constants are no longer required to match.
- Porymap will no longer overwrite ``include/constants/map_groups.h`` or ``include/constants/layouts.h``.

View File

@ -116,6 +116,10 @@ static void dump(const QString &value, QString &out, int *indent, bool isKey = f
static void dump(const Json::array &values, QString &out, int *indent) {
bool first = true;
if (!out.endsWith(": ")) out += QString(*indent * 2, ' ');
if (values.empty()) {
out += "[]";
return;
}
out += "[\n";
*indent += 1;
for (const auto &value : values) {

View File

@ -1297,7 +1297,7 @@ void Project::saveMap(Map *map) {
}
mapObj["connections"] = connectionsArr;
} else {
mapObj["connections"] = QJsonValue::Null;
mapObj["connections"] = OrderedJson();
}
if (map->sharedEventsMap().isEmpty()) {