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 83fe02a8dc - Show all commits

View file

@ -578,15 +578,14 @@ void Mass::getArmourParts() {
return;
}
if(armour_array->items.size() != 38) {
if(armour_array->items.size() != _armour.parts.size()) {
_state = State::Invalid;
return;
}
for(UnsignedInt i = 0; i < armour_array->items.size(); i++) {
auto part_prop = armour_array->at<GenericStructProperty>(i);
ArmourPart part;
auto& part = _armour.parts[i];
part.slot = part_prop->at<ByteProperty>("Slot_3_408BA56F4C9605C7E805CF91B642249C")->enumValue;
part.id = part_prop->at<IntProperty>("ID_5_ACD101864D3481DE96EDACACC09BDD25")->value;
@ -597,7 +596,7 @@ void Mass::getArmourParts() {
return;
}
if(part_styles->items.size() != 4) {
if(part_styles->items.size() != part.styles.size()) {
_state = State::Invalid;
return;
}
@ -612,15 +611,14 @@ void Mass::getArmourParts() {
return;
}
if(decals_array->items.size() != 8) {
if(decals_array->items.size() != part.decals.size()) {
part.demoDecals = decals_array->items.size();
_demo = true;
}
for(UnsignedInt j = 0; j < decals_array->items.size(); j++) {
auto decal_prop = decals_array->at<GenericStructProperty>(j);
Decal decal;
auto& decal = part.decals[j];
decal.id = decal_prop->at<IntProperty>("ID_3_694C0B35404D8A3168AEC89026BC8CF9")->value;
auto colour_prop = decal_prop->at<ColourStructProperty>("Color_8_1B0B9D2B43DA6AAB9FA549B374D3E606");
@ -637,25 +635,23 @@ void Mass::getArmourParts() {
decal.rotation = decal_prop->at<FloatProperty>("Rotation_27_12D7C314493D203D5C2326A03C5F910F")->value;
decal.flip = decal_prop->at<BoolProperty>("Flip_35_CECCFB184CCD9412BD93FE9A8B656BE1")->value;
decal.wrap = decal_prop->at<BoolProperty>("Wrap_43_A7C68CDF4A92AF2ECDA53F953EE7CA62")->value;
part.decals[j] = decal;
}
if(!_demo) {
auto accs_array = part_prop->at<ArrayProperty>("Accessories_52_D902DD4241FA0050C2529596255153F3");
if(!accs_array) {
_demo = true;
continue;
}
if(accs_array->items.size() != 8) {
if(accs_array->items.size() != part.accessories.size()) {
_state = State::Invalid;
return;
}
for(UnsignedInt j = 0; j < accs_array->items.size(); j++) {
auto acc_prop = accs_array->at<GenericStructProperty>(j);
Accessory accessory;
auto& accessory = part.accessories[j];
accessory.attachIndex = acc_prop->at<IntProperty>("AttachIndex_2_4AFCF6024E4BA7426C6B9F80B8179D20")->value;
accessory.id = acc_prop->at<IntProperty>("ID_4_5757B32647BAE263266259B8A7DFFFC1")->value;
@ -673,12 +669,8 @@ void Mass::getArmourParts() {
accessory.relativeRotationOffset = Vector3{rel_rot_offset_prop->x, rel_rot_offset_prop->y, rel_rot_offset_prop->z};
auto local_scale_prop = acc_prop->at<VectorStructProperty>("LocalScale_24_DC2D93A742A41A46E7E61D988F15ED53");
accessory.localScale = Vector3{local_scale_prop->x, local_scale_prop->y, local_scale_prop->z};
part.accessories[j] = std::move(accessory);
}
}
_armour.parts[i] = std::move(part);
}
}