mirror of
https://github.com/huderlem/porymap.git
synced 2026-10-03 21:36:52 -05:00
Save custom header values by type
This commit is contained in:
@@ -1440,7 +1440,28 @@ void Project::saveMap(Map *map) {
|
||||
|
||||
// Custom header fields.
|
||||
for (QString key : map->customHeaders.keys()) {
|
||||
//mapObj[key] = map->customHeaders[key];
|
||||
QJsonValue value = map->customHeaders[key];
|
||||
switch (value.type())
|
||||
{
|
||||
default:
|
||||
case QJsonValue::String:
|
||||
mapObj[key] = value.toString();
|
||||
break;
|
||||
case QJsonValue::Double:
|
||||
mapObj[key] = value.toInt();
|
||||
break;
|
||||
case QJsonValue::Bool:
|
||||
mapObj[key] = value.toBool();
|
||||
break;
|
||||
case QJsonValue::Array:
|
||||
// TODO: Custom array values are replaced with empty strings
|
||||
mapObj[key] = value.toString();
|
||||
break;
|
||||
case QJsonValue::Object:
|
||||
// TODO: Custom object values are replaced with empty strings
|
||||
mapObj[key] = value.toString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
OrderedJson mapJson(mapObj);
|
||||
|
||||
Reference in New Issue
Block a user