Build viewer/editor #13

Manually merged
williamjcm merged 128 commits from mass-viewer into master 2022-03-02 14:50:10 +01:00
Showing only changes of commit f500e982e6 - Show all commits

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,16 +69,25 @@ auto MapPropertySerialiser::deserialiseProperty(const std::string& name, const s
} }
UnrealPropertyBase::ptr value_item; UnrealPropertyBase::ptr value_item;
while((value_item = serialiser.read(reader)) != nullptr) { if(prop->valueType == "StructProperty") {
arrayAppend(pair.values, std::move(value_item)); while((value_item = serialiser.read(reader)) != nullptr) {
arrayAppend(pair.values, std::move(value_item));
if(pair.values.back()->name == "None" && if(pair.values.back()->name == "None" &&
pair.values.back()->propertyType == "NoneProperty" && pair.values.back()->propertyType == "NoneProperty" &&
dynamic_cast<NoneProperty*>(pair.values.back().get()) != nullptr) dynamic_cast<NoneProperty*>(pair.values.back().get()) != nullptr)
{ {
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));
} }