MapPropertySerialiser: add support for demo props.

This commit is contained in:
Guillaume Jacquemin 2021-09-22 19:35:16 +02:00
parent 2e1949ed5d
commit f500e982e6

View file

@ -58,7 +58,7 @@ auto MapPropertySerialiser::deserialiseProperty(const std::string& name, const s
for(UnsignedInt i = 0; i < count; i++) { for(UnsignedInt i = 0; i < count; i++) {
MapProperty::KeyValuePair pair; MapProperty::KeyValuePair pair;
if(prop->keyType == "IntProperty") { if(prop->keyType == "IntProperty" || prop->keyType == "StrProperty") {
pair.key = serialiser.readItem(reader, prop->keyType, -1, name); pair.key = serialiser.readItem(reader, prop->keyType, -1, name);
if(pair.key == nullptr) { if(pair.key == nullptr) {
return nullptr; return nullptr;
@ -69,6 +69,7 @@ auto MapPropertySerialiser::deserialiseProperty(const std::string& name, const s
} }
UnrealPropertyBase::ptr value_item; UnrealPropertyBase::ptr value_item;
if(prop->valueType == "StructProperty") {
while((value_item = serialiser.read(reader)) != nullptr) { while((value_item = serialiser.read(reader)) != nullptr) {
arrayAppend(pair.values, std::move(value_item)); arrayAppend(pair.values, std::move(value_item));
@ -79,6 +80,14 @@ auto MapPropertySerialiser::deserialiseProperty(const std::string& name, const s
break; break;
} }
} }
}
else if(prop->valueType == "ByteProperty") {
if((value_item = serialiser.readItem(reader, prop->valueType, -1, name)) == nullptr) {
return nullptr;
}
arrayAppend(pair.values, std::move(value_item));
}
arrayAppend(prop->map, std::move(pair)); arrayAppend(prop->map, std::move(pair));
} }