Mass: QoL changes.

Now property names are behind defines, so if a name changes, I don't
have to hunt it down in up to six source files.
This commit is contained in:
Guillaume Jacquemin 2022-11-21 18:00:38 +01:00
parent ee540b601e
commit 9ec88fa521
8 changed files with 301 additions and 190 deletions

View file

@ -159,6 +159,7 @@ add_executable(MassBuilderSaveTool WIN32
Mass/Mass_Weapons.cpp Mass/Mass_Weapons.cpp
Mass/Mass_Styles.cpp Mass/Mass_Styles.cpp
Mass/Mass_DecalsAccessories.cpp Mass/Mass_DecalsAccessories.cpp
Mass/PropertyNames.h
Mass/Weapon.h Mass/Weapon.h
Mass/Weapon.cpp Mass/Weapon.cpp
Mass/WeaponPart.h Mass/WeaponPart.h

View file

@ -21,6 +21,7 @@
#include <Corrade/Containers/ScopeGuard.h> #include <Corrade/Containers/ScopeGuard.h>
#include <Corrade/Utility/Path.h> #include <Corrade/Utility/Path.h>
#include "PropertyNames.h"
#include "../UESaveFile/Types/ArrayProperty.h" #include "../UESaveFile/Types/ArrayProperty.h"
#include "../UESaveFile/Types/BoolProperty.h" #include "../UESaveFile/Types/BoolProperty.h"
#include "../UESaveFile/Types/ColourStructProperty.h" #include "../UESaveFile/Types/ColourStructProperty.h"
@ -57,14 +58,14 @@ auto Mass::getNameFromFile(Containers::StringView path) -> Containers::Optional<
return Containers::NullOpt; return Containers::NullOpt;
} }
auto unit_data = mass.at<GenericStructProperty>("UnitData"_s); auto unit_data = mass.at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Couldn't find unit data in the file."_s; Utility::Error{} << "Couldn't find unit data in the file."_s;
return Containers::NullOpt; return Containers::NullOpt;
} }
auto name_prop = unit_data->at<StringProperty>("Name_45_A037C5D54E53456407BDF091344529BB"_s); auto name_prop = unit_data->at<StringProperty>(MASS_NAME);
if(!name_prop) { if(!name_prop) {
Utility::Error{} << "Couldn't find the name in the file."_s; Utility::Error{} << "Couldn't find the name in the file."_s;
@ -105,14 +106,14 @@ void Mass::refreshValues() {
Utility::Error{} << _filename << "is not a valid unit save."; Utility::Error{} << _filename << "is not a valid unit save.";
} }
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Couldn't find unit data in" << _filename; Utility::Error{} << "Couldn't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto name_prop = unit_data->at<StringProperty>("Name_45_A037C5D54E53456407BDF091344529BB"_s); auto name_prop = unit_data->at<StringProperty>(MASS_NAME);
if(!name_prop) { if(!name_prop) {
Utility::Error{} << "Couldn't find a M.A.S.S. name in" << _filename; Utility::Error{} << "Couldn't find a M.A.S.S. name in" << _filename;
@ -261,17 +262,19 @@ void Mass::setDirty(bool dirty) {
} }
void Mass::getTuning() { void Mass::getTuning() {
getTuningCategory("Engine"_s, _tuning.engineId, "Gears"_s, _tuning.gearIds); getTuningCategory(MASS_ENGINE, _tuning.engineId,
MASS_GEARS, _tuning.gearIds);
if(_state == State::Invalid) { if(_state == State::Invalid) {
return; return;
} }
getTuningCategory("OS"_s, _tuning.osId, "Modules"_s, _tuning.moduleIds); getTuningCategory(MASS_OS, _tuning.osId,
MASS_MODULES, _tuning.moduleIds);
if(_state == State::Invalid) { if(_state == State::Invalid) {
return; return;
} }
getTuningCategory("Architect"_s, _tuning.archId, "Techs"_s, _tuning.techIds); getTuningCategory(MASS_ARCHITECT, _tuning.archId,
if(_state == State::Invalid) { if(_state == State::Invalid) {
return; return;
} }
@ -308,7 +311,7 @@ auto Mass::account() -> Containers::StringView {
auto Mass::updateAccount(Containers::StringView new_account) -> bool { auto Mass::updateAccount(Containers::StringView new_account) -> bool {
_account = new_account; _account = new_account;
auto account = _mass->at<StringProperty>("Account"_s); auto account = _mass->at<StringProperty>(MASS_ACCOUNT);
if(!account) { if(!account) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "Couldn't find the account property."_s; _lastError = "Couldn't find the account property."_s;

View file

@ -16,6 +16,7 @@
#include <algorithm> #include <algorithm>
#include "PropertyNames.h"
#include "../UESaveFile/Types/ArrayProperty.h" #include "../UESaveFile/Types/ArrayProperty.h"
#include "../UESaveFile/Types/ByteProperty.h" #include "../UESaveFile/Types/ByteProperty.h"
#include "../UESaveFile/Types/GenericStructProperty.h" #include "../UESaveFile/Types/GenericStructProperty.h"
@ -32,14 +33,14 @@ auto Mass::armourParts() -> Containers::ArrayView<ArmourPart> {
} }
void Mass::getArmourParts() { void Mass::getArmourParts() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Couldn't find unit data in" << _filename; Utility::Error{} << "Couldn't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto armour_array = unit_data->at<ArrayProperty>("Armor_10_12E266C44116DDAF57E99ABB575A4B3C"_s); auto armour_array = unit_data->at<ArrayProperty>(MASS_ARMOUR_PARTS);
if(!armour_array) { if(!armour_array) {
Utility::Error{} << "Couldn't find the armour parts array in" << _filename; Utility::Error{} << "Couldn't find the armour parts array in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -56,7 +57,7 @@ void Mass::getArmourParts() {
auto part_prop = armour_array->at<GenericStructProperty>(i); auto part_prop = armour_array->at<GenericStructProperty>(i);
auto& part = _armour.parts[i]; auto& part = _armour.parts[i];
auto& armour_slot = part_prop->at<ByteProperty>("Slot_3_408BA56F4C9605C7E805CF91B642249C"_s)->enumValue; auto& armour_slot = part_prop->at<ByteProperty>(MASS_ARMOUR_SLOT)->enumValue;
#define c(enumerator, strenum, name) if(armour_slot == (strenum)) { part.slot = ArmourSlot::enumerator; } else #define c(enumerator, strenum, name) if(armour_slot == (strenum)) { part.slot = ArmourSlot::enumerator; } else
#include "../Maps/ArmourSlots.hpp" #include "../Maps/ArmourSlots.hpp"
#undef c #undef c
@ -65,9 +66,9 @@ void Mass::getArmourParts() {
Utility::Warning{} << "Invalid armour slot enum value in getArmourParts()."_s; Utility::Warning{} << "Invalid armour slot enum value in getArmourParts()."_s;
} }
part.id = part_prop->at<IntProperty>("ID_5_ACD101864D3481DE96EDACACC09BDD25"_s)->value; part.id = part_prop->at<IntProperty>(MASS_ARMOUR_ID)->value;
auto part_styles = part_prop->at<ArrayProperty>("Styles_47_3E31870441DFD7DB8BEE5C85C26B365B"_s); auto part_styles = part_prop->at<ArrayProperty>(MASS_ARMOUR_STYLES);
if(!part_styles) { if(!part_styles) {
Utility::Error{} << "Part styles not found for part number" << i << "in" << _filename; Utility::Error{} << "Part styles not found for part number" << i << "in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -84,7 +85,7 @@ void Mass::getArmourParts() {
part.styles[j] = part_styles->at<IntProperty>(j)->value; part.styles[j] = part_styles->at<IntProperty>(j)->value;
} }
auto decals_array = part_prop->at<ArrayProperty>("Decals_42_F358794A4F18497970F56BA9627D3603"_s); auto decals_array = part_prop->at<ArrayProperty>(MASS_ARMOUR_DECALS);
if(!decals_array) { if(!decals_array) {
Utility::Error{} << "Part decals not found for part number" << i << "in" << _filename; Utility::Error{} << "Part decals not found for part number" << i << "in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -95,7 +96,7 @@ void Mass::getArmourParts() {
getDecals(part.decals, decals_array); getDecals(part.decals, decals_array);
auto accs_array = part_prop->at<ArrayProperty>("Accessories_52_D902DD4241FA0050C2529596255153F3"_s); auto accs_array = part_prop->at<ArrayProperty>(MASS_ARMOUR_ACCESSORIES);
if(!accs_array) { if(!accs_array) {
Utility::Error{} << "Part accessories not found for part number" << i << "in" << _filename; Utility::Error{} << "Part accessories not found for part number" << i << "in" << _filename;
part.accessories = Containers::Array<Accessory>{}; part.accessories = Containers::Array<Accessory>{};
@ -113,9 +114,9 @@ void Mass::getArmourParts() {
auto Mass::writeArmourPart(ArmourSlot slot) -> bool { auto Mass::writeArmourPart(ArmourSlot slot) -> bool {
auto& part = *std::find_if(_armour.parts.begin(), _armour.parts.end(), [&slot](const ArmourPart& part){ return slot == part.slot; }); auto& part = *std::find_if(_armour.parts.begin(), _armour.parts.end(), [&slot](const ArmourPart& part){ return slot == part.slot; });
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
auto armour_array = unit_data->at<ArrayProperty>("Armor_10_12E266C44116DDAF57E99ABB575A4B3C"_s); auto armour_array = unit_data->at<ArrayProperty>(MASS_ARMOUR_PARTS);
Containers::StringView slot_str = nullptr; Containers::StringView slot_str = nullptr;
switch(slot) { switch(slot) {
@ -130,7 +131,7 @@ auto Mass::writeArmourPart(ArmourSlot slot) -> bool {
for(UnsignedInt i = 0; i < armour_array->items.size(); i++) { for(UnsignedInt i = 0; i < armour_array->items.size(); i++) {
part_prop = armour_array->at<GenericStructProperty>(i); part_prop = armour_array->at<GenericStructProperty>(i);
if(slot_str == part_prop->at<ByteProperty>("Slot_3_408BA56F4C9605C7E805CF91B642249C"_s)->enumValue) { if(slot_str == part_prop->at<ByteProperty>(MASS_ARMOUR_SLOT)->enumValue) {
break; break;
} }
else { else {
@ -150,18 +151,18 @@ auto Mass::writeArmourPart(ArmourSlot slot) -> bool {
return false; return false;
} }
part_prop->at<IntProperty>("ID_5_ACD101864D3481DE96EDACACC09BDD25"_s)->value = part.id; part_prop->at<IntProperty>(MASS_ARMOUR_ID)->value = part.id;
auto part_styles = part_prop->at<ArrayProperty>("Styles_47_3E31870441DFD7DB8BEE5C85C26B365B"_s); auto part_styles = part_prop->at<ArrayProperty>(MASS_ARMOUR_STYLES);
for(UnsignedInt i = 0; i < part.styles.size(); i++) { for(UnsignedInt i = 0; i < part.styles.size(); i++) {
part_styles->at<IntProperty>(i)->value = part.styles[i]; part_styles->at<IntProperty>(i)->value = part.styles[i];
} }
auto decals_array = part_prop->at<ArrayProperty>("Decals_42_F358794A4F18497970F56BA9627D3603"_s); auto decals_array = part_prop->at<ArrayProperty>(MASS_ARMOUR_DECALS);
writeDecals(part.decals, decals_array); writeDecals(part.decals, decals_array);
if(part.accessories.size() != 0) { if(part.accessories.size() != 0) {
auto accs_array = part_prop->at<ArrayProperty>("Accessories_52_D902DD4241FA0050C2529596255153F3"_s); auto accs_array = part_prop->at<ArrayProperty>(MASS_ARMOUR_ACCESSORIES);
writeAccessories(part.accessories, accs_array); writeAccessories(part.accessories, accs_array);
} }
@ -182,15 +183,15 @@ auto Mass::bulletLauncherAttachments() -> Containers::ArrayView<BulletLauncherAt
} }
void Mass::getBulletLauncherAttachments() { void Mass::getBulletLauncherAttachments() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Couldn't find unit data in" << _filename; Utility::Error{} << "Couldn't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto attach_style_prop = unit_data->at<ByteProperty>("WeaponBLAttachmentStyle_65_5943FCE8406F18D2C3F69285EB23A699"_s); auto attach_style_prop = unit_data->at<ByteProperty>(MASS_BL_ATTACHMENT_STYLE);
auto attach_array = unit_data->at<ArrayProperty>("WeaponBLAttachment_61_442D08F547510A4CEE1501BBAF297BA0"_s); auto attach_array = unit_data->at<ArrayProperty>(MASS_BL_ATTACHMENTS);
if(!attach_style_prop && !attach_array) { if(!attach_style_prop && !attach_array) {
_armour.blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound; _armour.blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound;
@ -211,7 +212,7 @@ void Mass::getBulletLauncherAttachments() {
auto attachment_prop = attach_array->at<GenericStructProperty>(i); auto attachment_prop = attach_array->at<GenericStructProperty>(i);
auto& attachment = _armour.blAttachment[i]; auto& attachment = _armour.blAttachment[i];
Containers::StringView socket = attachment_prop->at<StringProperty>("Socket_9_B9DBF30D4A1F0032A2BE2F8B342B35A9"_s)->value; Containers::StringView socket = attachment_prop->at<StringProperty>(MASS_BL_ATTACHMENT_SOCKET)->value;
#define c(enumerator, strenum, name) if(socket == (strenum)) { attachment.socket = BulletLauncherSocket::enumerator; } else #define c(enumerator, strenum, name) if(socket == (strenum)) { attachment.socket = BulletLauncherSocket::enumerator; } else
#include "../Maps/BulletLauncherSockets.hpp" #include "../Maps/BulletLauncherSockets.hpp"
#undef c #undef c
@ -221,15 +222,15 @@ void Mass::getBulletLauncherAttachments() {
return; return;
} }
auto rel_loc_prop = attachment_prop->at<VectorStructProperty>("RelativeLocation_10_2F6E75DF4C40622658340E9A22D38B02"_s); auto rel_loc_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_RELLOC);
attachment.relativeLocation = Vector3{rel_loc_prop->x, rel_loc_prop->y, rel_loc_prop->z}; attachment.relativeLocation = Vector3{rel_loc_prop->x, rel_loc_prop->y, rel_loc_prop->z};
auto off_loc_prop = attachment_prop->at<VectorStructProperty>("OffsetLocation_11_F42B3DA3436948FF85752DB33722382F"_s); auto off_loc_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_OFFLOC);
attachment.offsetLocation = Vector3{off_loc_prop->x, off_loc_prop->y, off_loc_prop->z}; attachment.offsetLocation = Vector3{off_loc_prop->x, off_loc_prop->y, off_loc_prop->z};
auto rel_rot_prop = attachment_prop->at<VectorStructProperty>("RelativeRotation_12_578140464621245132CFF2A2AD85E735"_s); auto rel_rot_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_RELROT);
attachment.relativeRotation = Vector3{rel_rot_prop->x, rel_rot_prop->y, rel_rot_prop->z}; attachment.relativeRotation = Vector3{rel_rot_prop->x, rel_rot_prop->y, rel_rot_prop->z};
auto off_rot_prop = attachment_prop->at<VectorStructProperty>("OffsetRotation_13_B5980BCD47905D842D1490A1A520B064"_s); auto off_rot_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_OFFROT);
attachment.offsetRotation = Vector3{off_rot_prop->x, off_rot_prop->y, off_rot_prop->z}; attachment.offsetRotation = Vector3{off_rot_prop->x, off_rot_prop->y, off_rot_prop->z};
auto rel_scale_prop = attachment_prop->at<VectorStructProperty>("RelativeScale_16_37BC80EF42699F79533F7AA7B3094E38"_s); auto rel_scale_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_RELSCALE);
attachment.relativeScale = Vector3{rel_scale_prop->x, rel_scale_prop->y, rel_scale_prop->z}; attachment.relativeScale = Vector3{rel_scale_prop->x, rel_scale_prop->y, rel_scale_prop->z};
} }
} }
@ -249,15 +250,15 @@ void Mass::getBulletLauncherAttachments() {
} }
auto Mass::writeBulletLauncherAttachments() -> bool { auto Mass::writeBulletLauncherAttachments() -> bool {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data in " + _filename; _lastError = "No unit data in " + _filename;
return false; return false;
} }
auto attach_style_prop = unit_data->at<ByteProperty>("WeaponBLAttachmentStyle_65_5943FCE8406F18D2C3F69285EB23A699"_s); auto attach_style_prop = unit_data->at<ByteProperty>(MASS_BL_ATTACHMENT_STYLE);
auto attach_array = unit_data->at<ArrayProperty>("WeaponBLAttachment_61_442D08F547510A4CEE1501BBAF297BA0"_s); auto attach_array = unit_data->at<ArrayProperty>(MASS_BL_ATTACHMENTS);
if(!attach_style_prop && !attach_array) { if(!attach_style_prop && !attach_array) {
_armour.blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound; _armour.blAttachmentStyle = BulletLauncherAttachmentStyle::NotFound;
@ -279,7 +280,7 @@ auto Mass::writeBulletLauncherAttachments() -> bool {
auto attachment_prop = attach_array->at<GenericStructProperty>(i); auto attachment_prop = attach_array->at<GenericStructProperty>(i);
auto& attachment = _armour.blAttachment[i]; auto& attachment = _armour.blAttachment[i];
auto& socket = attachment_prop->at<StringProperty>("Socket_9_B9DBF30D4A1F0032A2BE2F8B342B35A9"_s)->value; auto& socket = attachment_prop->at<StringProperty>(MASS_BL_ATTACHMENT_SOCKET)->value;
switch(attachment.socket) { switch(attachment.socket) {
#define c(enumerator, strenum, name) case BulletLauncherSocket::enumerator: socket = strenum; break; #define c(enumerator, strenum, name) case BulletLauncherSocket::enumerator: socket = strenum; break;
#include "../Maps/BulletLauncherSockets.hpp" #include "../Maps/BulletLauncherSockets.hpp"
@ -289,23 +290,23 @@ auto Mass::writeBulletLauncherAttachments() -> bool {
return false; return false;
} }
auto rel_loc_prop = attachment_prop->at<VectorStructProperty>("RelativeLocation_10_2F6E75DF4C40622658340E9A22D38B02"_s); auto rel_loc_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_RELLOC);
rel_loc_prop->x = attachment.relativeLocation.x(); rel_loc_prop->x = attachment.relativeLocation.x();
rel_loc_prop->y = attachment.relativeLocation.y(); rel_loc_prop->y = attachment.relativeLocation.y();
rel_loc_prop->z = attachment.relativeLocation.z(); rel_loc_prop->z = attachment.relativeLocation.z();
auto off_loc_prop = attachment_prop->at<VectorStructProperty>("OffsetLocation_11_F42B3DA3436948FF85752DB33722382F"_s); auto off_loc_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_OFFLOC);
off_loc_prop->x = attachment.offsetLocation.x(); off_loc_prop->x = attachment.offsetLocation.x();
off_loc_prop->y = attachment.offsetLocation.y(); off_loc_prop->y = attachment.offsetLocation.y();
off_loc_prop->z = attachment.offsetLocation.z(); off_loc_prop->z = attachment.offsetLocation.z();
auto rel_rot_prop = attachment_prop->at<VectorStructProperty>("RelativeRotation_12_578140464621245132CFF2A2AD85E735"_s); auto rel_rot_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_RELROT);
rel_rot_prop->x = attachment.relativeRotation.x(); rel_rot_prop->x = attachment.relativeRotation.x();
rel_rot_prop->y = attachment.relativeRotation.y(); rel_rot_prop->y = attachment.relativeRotation.y();
rel_rot_prop->z = attachment.relativeRotation.z(); rel_rot_prop->z = attachment.relativeRotation.z();
auto off_rot_prop = attachment_prop->at<VectorStructProperty>("OffsetRotation_13_B5980BCD47905D842D1490A1A520B064"_s); auto off_rot_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_OFFROT);
off_rot_prop->x = attachment.offsetRotation.x(); off_rot_prop->x = attachment.offsetRotation.x();
off_rot_prop->y = attachment.offsetRotation.y(); off_rot_prop->y = attachment.offsetRotation.y();
off_rot_prop->z = attachment.offsetRotation.z(); off_rot_prop->z = attachment.offsetRotation.z();
auto rel_scale_prop = attachment_prop->at<VectorStructProperty>("RelativeScale_16_37BC80EF42699F79533F7AA7B3094E38"_s); auto rel_scale_prop = attachment_prop->at<VectorStructProperty>(MASS_BL_ATTACHMENT_RELSCALE);
rel_scale_prop->x = attachment.relativeScale.x(); rel_scale_prop->x = attachment.relativeScale.x();
rel_scale_prop->y = attachment.relativeScale.y(); rel_scale_prop->y = attachment.relativeScale.y();
rel_scale_prop->z = attachment.relativeScale.z(); rel_scale_prop->z = attachment.relativeScale.z();
@ -314,7 +315,7 @@ auto Mass::writeBulletLauncherAttachments() -> bool {
if(!attach_style_prop) { if(!attach_style_prop) {
attach_style_prop = new ByteProperty; attach_style_prop = new ByteProperty;
attach_style_prop->name.emplace("WeaponBLAttachmentStyle_65_5943FCE8406F18D2C3F69285EB23A699"_s); attach_style_prop->name.emplace(MASS_BL_ATTACHMENT_STYLE);
attach_style_prop->enumType = "enuBLAttachmentStyle"_s; attach_style_prop->enumType = "enuBLAttachmentStyle"_s;
ByteProperty::ptr prop{attach_style_prop}; ByteProperty::ptr prop{attach_style_prop};
arrayAppend(unit_data->properties, std::move(prop)); arrayAppend(unit_data->properties, std::move(prop));
@ -345,14 +346,14 @@ auto Mass::armourCustomStyles() -> Containers::ArrayView<CustomStyle> {
} }
void Mass::getArmourCustomStyles() { void Mass::getArmourCustomStyles() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Couldn't find unit data in" << _filename; Utility::Error{} << "Couldn't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto armour_styles = unit_data->at<ArrayProperty>("ArmorStyle_42_E2F6AC3647788CB366BD469B3B7E899E"_s); auto armour_styles = unit_data->at<ArrayProperty>(MASS_CUSTOM_ARMOUR_STYLES);
if(!armour_styles) { if(!armour_styles) {
Utility::Error{} << "Couldn't find custom armour styles in" << _filename; Utility::Error{} << "Couldn't find custom armour styles in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -374,14 +375,14 @@ auto Mass::writeArmourCustomStyle(UnsignedLong index) -> bool {
return false; return false;
} }
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "Couldn't find unit data in "_s + _filename; _lastError = "Couldn't find unit data in "_s + _filename;
return false; return false;
} }
auto armour_styles = unit_data->at<ArrayProperty>("ArmorStyle_42_E2F6AC3647788CB366BD469B3B7E899E"_s); auto armour_styles = unit_data->at<ArrayProperty>(MASS_CUSTOM_ARMOUR_STYLES);
if(!armour_styles) { if(!armour_styles) {
_lastError = "Couldn't find armour custom styles in "_s + _filename; _lastError = "Couldn't find armour custom styles in "_s + _filename;
_state = State::Invalid; _state = State::Invalid;

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "PropertyNames.h"
#include "../UESaveFile/Types/ArrayProperty.h" #include "../UESaveFile/Types/ArrayProperty.h"
#include "../UESaveFile/Types/BoolProperty.h" #include "../UESaveFile/Types/BoolProperty.h"
#include "../UESaveFile/Types/ColourStructProperty.h" #include "../UESaveFile/Types/ColourStructProperty.h"
@ -34,21 +35,21 @@ void Mass::getDecals(Containers::ArrayView<Decal> decals, ArrayProperty* decal_a
CORRADE_INTERNAL_ASSERT(decal_prop); CORRADE_INTERNAL_ASSERT(decal_prop);
auto& decal = decals[i]; auto& decal = decals[i];
decal.id = decal_prop->at<IntProperty>("ID_3_694C0B35404D8A3168AEC89026BC8CF9"_s)->value; decal.id = decal_prop->at<IntProperty>(MASS_DECAL_ID)->value;
auto colour_prop = decal_prop->at<ColourStructProperty>("Color_8_1B0B9D2B43DA6AAB9FA549B374D3E606"_s); auto colour_prop = decal_prop->at<ColourStructProperty>(MASS_DECAL_COLOUR);
decal.colour = Color4{colour_prop->r, colour_prop->g, colour_prop->b, colour_prop->a}; decal.colour = Color4{colour_prop->r, colour_prop->g, colour_prop->b, colour_prop->a};
auto pos_prop = decal_prop->at<VectorStructProperty>("Position_41_022C8FE84E1AAFE587261E88F2C72250"_s); auto pos_prop = decal_prop->at<VectorStructProperty>(MASS_DECAL_POSITION);
decal.position = Vector3{pos_prop->x, pos_prop->y, pos_prop->z}; decal.position = Vector3{pos_prop->x, pos_prop->y, pos_prop->z};
auto u_prop = decal_prop->at<VectorStructProperty>("UAxis_37_EBEB715F45491AECACCC07A1AE4646D1"_s); auto u_prop = decal_prop->at<VectorStructProperty>(MASS_DECAL_UAXIS);
decal.uAxis = Vector3{u_prop->x, u_prop->y, u_prop->z}; decal.uAxis = Vector3{u_prop->x, u_prop->y, u_prop->z};
auto v_prop = decal_prop->at<VectorStructProperty>("VAxis_39_C31EB2664EE202CAECFBBB84100B5E35"_s); auto v_prop = decal_prop->at<VectorStructProperty>(MASS_DECAL_VAXIS);
decal.vAxis = Vector3{v_prop->x, v_prop->y, v_prop->z}; decal.vAxis = Vector3{v_prop->x, v_prop->y, v_prop->z};
auto offset_prop = decal_prop->at<Vector2DStructProperty>("Offset_29_B02BBBB74FC60F5EDBEBAB8020738020"_s); auto offset_prop = decal_prop->at<Vector2DStructProperty>(MASS_DECAL_OFFSET);
decal.offset = Vector2{offset_prop->x, offset_prop->y}; decal.offset = Vector2{offset_prop->x, offset_prop->y};
decal.scale = decal_prop->at<FloatProperty>("Scale_32_959D1C2747AFD8D62808468235CBBA40"_s)->value; decal.scale = decal_prop->at<FloatProperty>(MASS_DECAL_SCALE)->value;
decal.rotation = decal_prop->at<FloatProperty>("Rotation_27_12D7C314493D203D5C2326A03C5F910F"_s)->value; decal.rotation = decal_prop->at<FloatProperty>(MASS_DECAL_ROTATION)->value;
decal.flip = decal_prop->at<BoolProperty>("Flip_35_CECCFB184CCD9412BD93FE9A8B656BE1"_s)->value; decal.flip = decal_prop->at<BoolProperty>(MASS_DECAL_FLIP)->value;
decal.wrap = decal_prop->at<BoolProperty>("Wrap_43_A7C68CDF4A92AF2ECDA53F953EE7CA62"_s)->value; decal.wrap = decal_prop->at<BoolProperty>(MASS_DECAL_WRAP)->value;
} }
} }
@ -58,31 +59,31 @@ void Mass::writeDecals(Containers::ArrayView<Decal> decals, ArrayProperty* decal
CORRADE_INTERNAL_ASSERT(decal_prop); CORRADE_INTERNAL_ASSERT(decal_prop);
auto& decal = decals[i]; auto& decal = decals[i];
decal_prop->at<IntProperty>("ID_3_694C0B35404D8A3168AEC89026BC8CF9"_s)->value = decal.id; decal_prop->at<IntProperty>(MASS_DECAL_ID)->value = decal.id;
auto colour_prop = decal_prop->at<ColourStructProperty>("Color_8_1B0B9D2B43DA6AAB9FA549B374D3E606"_s); auto colour_prop = decal_prop->at<ColourStructProperty>(MASS_DECAL_COLOUR);
colour_prop->r = decal.colour.r(); colour_prop->r = decal.colour.r();
colour_prop->g = decal.colour.g(); colour_prop->g = decal.colour.g();
colour_prop->b = decal.colour.b(); colour_prop->b = decal.colour.b();
colour_prop->a = decal.colour.a(); colour_prop->a = decal.colour.a();
auto pos_prop = decal_prop->at<VectorStructProperty>("Position_41_022C8FE84E1AAFE587261E88F2C72250"_s); auto pos_prop = decal_prop->at<VectorStructProperty>(MASS_DECAL_POSITION);
pos_prop->x = decal.position.x(); pos_prop->x = decal.position.x();
pos_prop->y = decal.position.y(); pos_prop->y = decal.position.y();
pos_prop->z = decal.position.z(); pos_prop->z = decal.position.z();
auto u_prop = decal_prop->at<VectorStructProperty>("UAxis_37_EBEB715F45491AECACCC07A1AE4646D1"_s); auto u_prop = decal_prop->at<VectorStructProperty>(MASS_DECAL_UAXIS);
u_prop->x = decal.uAxis.x(); u_prop->x = decal.uAxis.x();
u_prop->y = decal.uAxis.y(); u_prop->y = decal.uAxis.y();
u_prop->z = decal.uAxis.z(); u_prop->z = decal.uAxis.z();
auto v_prop = decal_prop->at<VectorStructProperty>("VAxis_39_C31EB2664EE202CAECFBBB84100B5E35"_s); auto v_prop = decal_prop->at<VectorStructProperty>(MASS_DECAL_VAXIS);
v_prop->x = decal.vAxis.x(); v_prop->x = decal.vAxis.x();
v_prop->y = decal.vAxis.y(); v_prop->y = decal.vAxis.y();
v_prop->z = decal.vAxis.z(); v_prop->z = decal.vAxis.z();
auto offset_prop = decal_prop->at<Vector2DStructProperty>("Offset_29_B02BBBB74FC60F5EDBEBAB8020738020"_s); auto offset_prop = decal_prop->at<Vector2DStructProperty>(MASS_DECAL_OFFSET);
offset_prop->x = decal.offset.x(); offset_prop->x = decal.offset.x();
offset_prop->y = decal.offset.y(); offset_prop->y = decal.offset.y();
decal_prop->at<FloatProperty>("Scale_32_959D1C2747AFD8D62808468235CBBA40"_s)->value = decal.scale; decal_prop->at<FloatProperty>(MASS_DECAL_SCALE)->value = decal.scale;
decal_prop->at<FloatProperty>("Rotation_27_12D7C314493D203D5C2326A03C5F910F"_s)->value = decal.rotation; decal_prop->at<FloatProperty>(MASS_DECAL_ROTATION)->value = decal.rotation;
decal_prop->at<BoolProperty>("Flip_35_CECCFB184CCD9412BD93FE9A8B656BE1"_s)->value = decal.flip; decal_prop->at<BoolProperty>(MASS_DECAL_FLIP)->value = decal.flip;
decal_prop->at<BoolProperty>("Wrap_43_A7C68CDF4A92AF2ECDA53F953EE7CA62"_s)->value = decal.wrap; decal_prop->at<BoolProperty>(MASS_DECAL_WRAP)->value = decal.wrap;
} }
} }
@ -92,21 +93,21 @@ void Mass::getAccessories(Containers::ArrayView<Accessory> accessories, ArrayPro
CORRADE_INTERNAL_ASSERT(acc_prop); CORRADE_INTERNAL_ASSERT(acc_prop);
auto& accessory = accessories[i]; auto& accessory = accessories[i];
accessory.attachIndex = acc_prop->at<IntProperty>("AttachIndex_2_4AFCF6024E4BA7426C6B9F80B8179D20"_s)->value; accessory.attachIndex = acc_prop->at<IntProperty>(MASS_ACCESSORY_ATTACH_INDEX)->value;
accessory.id = acc_prop->at<IntProperty>("ID_4_5757B32647BAE263266259B8A7DFFFC1"_s)->value; accessory.id = acc_prop->at<IntProperty>(MASS_ACCESSORY_ID)->value;
auto acc_styles = acc_prop->at<ArrayProperty>("Styles_7_91DEB0F24E24D13FC9472882C11D0DFD"_s); auto acc_styles = acc_prop->at<ArrayProperty>(MASS_ACCESSORY_STYLES);
for(UnsignedInt j = 0; j < acc_styles->items.size(); j++) { for(UnsignedInt j = 0; j < acc_styles->items.size(); j++) {
accessory.styles[j] = acc_styles->at<IntProperty>(j)->value; accessory.styles[j] = acc_styles->at<IntProperty>(j)->value;
} }
auto rel_pos_prop = acc_prop->at<VectorStructProperty>("RelativePosition_14_BE8FB2A94074F34B3EDA6683B227D3A1"_s); auto rel_pos_prop = acc_prop->at<VectorStructProperty>(MASS_ACCESSORY_RELPOS);
accessory.relativePosition = Vector3{rel_pos_prop->x, rel_pos_prop->y, rel_pos_prop->z}; accessory.relativePosition = Vector3{rel_pos_prop->x, rel_pos_prop->y, rel_pos_prop->z};
auto rel_pos_offset_prop = acc_prop->at<VectorStructProperty>("RelativePositionOffset_15_98FD0CE74E44BBAFC2D46FB4CA4E0ED6"_s); auto rel_pos_offset_prop = acc_prop->at<VectorStructProperty>(MASS_ACCESSORY_OFFPOS);
accessory.relativePositionOffset = Vector3{rel_pos_offset_prop->x, rel_pos_offset_prop->y, rel_pos_offset_prop->z}; accessory.relativePositionOffset = Vector3{rel_pos_offset_prop->x, rel_pos_offset_prop->y, rel_pos_offset_prop->z};
auto rel_rot_prop = acc_prop->at<RotatorStructProperty>("RelativeRotation_20_C78C73274E6E78E7878F8C98ECA342C0"_s); auto rel_rot_prop = acc_prop->at<RotatorStructProperty>(MASS_ACCESSORY_RELROT);
accessory.relativeRotation = Vector3{rel_rot_prop->x, rel_rot_prop->y, rel_rot_prop->z}; accessory.relativeRotation = Vector3{rel_rot_prop->x, rel_rot_prop->y, rel_rot_prop->z};
auto rel_rot_offset_prop = acc_prop->at<RotatorStructProperty>("RelativeRotationOffset_21_E07FA0EC46728B7BA763C6861249ABAA"_s); auto rel_rot_offset_prop = acc_prop->at<RotatorStructProperty>(MASS_ACCESSORY_OFFROT);
accessory.relativeRotationOffset = Vector3{rel_rot_offset_prop->x, rel_rot_offset_prop->y, rel_rot_offset_prop->z}; 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"_s); auto local_scale_prop = acc_prop->at<VectorStructProperty>(MASS_ACCESSORY_SCALE);
accessory.localScale = Vector3{local_scale_prop->x, local_scale_prop->y, local_scale_prop->z}; accessory.localScale = Vector3{local_scale_prop->x, local_scale_prop->y, local_scale_prop->z};
} }
} }
@ -117,29 +118,29 @@ void Mass::writeAccessories(Containers::ArrayView<Accessory> accessories, ArrayP
CORRADE_INTERNAL_ASSERT(acc_prop); CORRADE_INTERNAL_ASSERT(acc_prop);
auto& accessory = accessories[i]; auto& accessory = accessories[i];
acc_prop->at<IntProperty>("AttachIndex_2_4AFCF6024E4BA7426C6B9F80B8179D20"_s)->value = accessory.attachIndex; acc_prop->at<IntProperty>(MASS_ACCESSORY_ATTACH_INDEX)->value = accessory.attachIndex;
acc_prop->at<IntProperty>("ID_4_5757B32647BAE263266259B8A7DFFFC1"_s)->value = accessory.id; acc_prop->at<IntProperty>(MASS_ACCESSORY_ID)->value = accessory.id;
auto acc_styles = acc_prop->at<ArrayProperty>("Styles_7_91DEB0F24E24D13FC9472882C11D0DFD"_s); auto acc_styles = acc_prop->at<ArrayProperty>(MASS_ACCESSORY_STYLES);
for(UnsignedInt j = 0; j < acc_styles->items.size(); j++) { for(UnsignedInt j = 0; j < acc_styles->items.size(); j++) {
acc_styles->at<IntProperty>(j)->value = accessory.styles[j]; acc_styles->at<IntProperty>(j)->value = accessory.styles[j];
} }
auto rel_pos_prop = acc_prop->at<VectorStructProperty>("RelativePosition_14_BE8FB2A94074F34B3EDA6683B227D3A1"_s); auto rel_pos_prop = acc_prop->at<VectorStructProperty>(MASS_ACCESSORY_RELPOS);
rel_pos_prop->x = accessory.relativePosition.x(); rel_pos_prop->x = accessory.relativePosition.x();
rel_pos_prop->y = accessory.relativePosition.y(); rel_pos_prop->y = accessory.relativePosition.y();
rel_pos_prop->z = accessory.relativePosition.z(); rel_pos_prop->z = accessory.relativePosition.z();
auto rel_pos_offset_prop = acc_prop->at<VectorStructProperty>("RelativePositionOffset_15_98FD0CE74E44BBAFC2D46FB4CA4E0ED6"_s); auto rel_pos_offset_prop = acc_prop->at<VectorStructProperty>(MASS_ACCESSORY_OFFPOS);
rel_pos_offset_prop->x = accessory.relativePositionOffset.x(); rel_pos_offset_prop->x = accessory.relativePositionOffset.x();
rel_pos_offset_prop->y = accessory.relativePositionOffset.y(); rel_pos_offset_prop->y = accessory.relativePositionOffset.y();
rel_pos_offset_prop->z = accessory.relativePositionOffset.z(); rel_pos_offset_prop->z = accessory.relativePositionOffset.z();
auto rel_rot_prop = acc_prop->at<RotatorStructProperty>("RelativeRotation_20_C78C73274E6E78E7878F8C98ECA342C0"_s); auto rel_rot_prop = acc_prop->at<RotatorStructProperty>(MASS_ACCESSORY_RELROT);
rel_rot_prop->x = accessory.relativeRotation.x(); rel_rot_prop->x = accessory.relativeRotation.x();
rel_rot_prop->y = accessory.relativeRotation.y(); rel_rot_prop->y = accessory.relativeRotation.y();
rel_rot_prop->z = accessory.relativeRotation.z(); rel_rot_prop->z = accessory.relativeRotation.z();
auto rel_rot_offset_prop = acc_prop->at<RotatorStructProperty>("RelativeRotationOffset_21_E07FA0EC46728B7BA763C6861249ABAA"_s); auto rel_rot_offset_prop = acc_prop->at<RotatorStructProperty>(MASS_ACCESSORY_OFFROT);
rel_rot_offset_prop->x = accessory.relativeRotationOffset.x(); rel_rot_offset_prop->x = accessory.relativeRotationOffset.x();
rel_rot_offset_prop->y = accessory.relativeRotationOffset.y(); rel_rot_offset_prop->y = accessory.relativeRotationOffset.y();
rel_rot_offset_prop->z = accessory.relativeRotationOffset.z(); rel_rot_offset_prop->z = accessory.relativeRotationOffset.z();
auto local_scale_prop = acc_prop->at<VectorStructProperty>("LocalScale_24_DC2D93A742A41A46E7E61D988F15ED53"_s); auto local_scale_prop = acc_prop->at<VectorStructProperty>(MASS_ACCESSORY_SCALE);
local_scale_prop->x = accessory.localScale.x(); local_scale_prop->x = accessory.localScale.x();
local_scale_prop->y = accessory.localScale.y(); local_scale_prop->y = accessory.localScale.y();
local_scale_prop->z = accessory.localScale.z(); local_scale_prop->z = accessory.localScale.z();

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "PropertyNames.h"
#include "../UESaveFile/Types/ArrayProperty.h" #include "../UESaveFile/Types/ArrayProperty.h"
#include "../UESaveFile/Types/ColourStructProperty.h" #include "../UESaveFile/Types/ColourStructProperty.h"
#include "../UESaveFile/Types/FloatProperty.h" #include "../UESaveFile/Types/FloatProperty.h"
@ -29,48 +30,48 @@ auto Mass::jointSliders() -> Joints& {
} }
void Mass::getJointSliders() { void Mass::getJointSliders() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Can't find unit data in" << _filename; Utility::Error{} << "Can't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto frame_prop = unit_data->at<GenericStructProperty>("Frame_3_F92B0F6A44A15088AF7F41B9FF290653"_s); auto frame_prop = unit_data->at<GenericStructProperty>(MASS_FRAME);
if(!frame_prop) { if(!frame_prop) {
Utility::Error{} << "Can't find frame data in" << _filename; Utility::Error{} << "Can't find frame data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto length = frame_prop->at<FloatProperty>("NeckLength_6_ED6AF79849C27CD1A9D523A09E2BFE58"_s); auto length = frame_prop->at<FloatProperty>(MASS_JOINT_NECK);
_frame.joints.neck = (length ? length->value : 0.0f); _frame.joints.neck = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("BodyLength_7_C16287754CBA96C93BAE36A5C154996A"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_BODY);
_frame.joints.body = (length ? length->value : 0.0f); _frame.joints.body = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("ShoulderLength_8_220EDF304F1C1226F0D8D39117FB3883"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_SHOULDER);
_frame.joints.shoulders = (length ? length->value : 0.0f); _frame.joints.shoulders = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("HipLength_14_02AEEEAC4376087B9C51F0AA7CC92818"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_HIP);
_frame.joints.hips = (length ? length->value : 0.0f); _frame.joints.hips = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("ArmUpperLength_10_249FDA3E4F3B399E7B9E5C9B7C765EAE"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_ARM_UPPER);
_frame.joints.upperArms = (length ? length->value : 0.0f); _frame.joints.upperArms = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("ArmLowerLength_12_ACD0F02745C28882619376926292FB36"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_ARM_LOWER);
_frame.joints.lowerArms = (length ? length->value : 0.0f); _frame.joints.lowerArms = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("LegUpperLength_16_A7C4C71249A3776F7A543D96819C0C61"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_LEG_UPPER);
_frame.joints.upperLegs = (length ? length->value : 0.0f); _frame.joints.upperLegs = (length ? length->value : 0.0f);
length = frame_prop->at<FloatProperty>("LegLowerLength_18_D2DF39964EA0F2A2129D0491B08A032F"_s); length = frame_prop->at<FloatProperty>(MASS_JOINT_LEG_LOWER);
_frame.joints.lowerLegs = (length ? length->value : 0.0f); _frame.joints.lowerLegs = (length ? length->value : 0.0f);
} }
auto Mass::writeJointSliders() -> bool { auto Mass::writeJointSliders() -> bool {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s);
auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data in "_s + _filename; _lastError = "No unit data in "_s + _filename;
return false; return false;
} }
auto frame_prop = unit_data->at<GenericStructProperty>("Frame_3_F92B0F6A44A15088AF7F41B9FF290653"_s); auto frame_prop = unit_data->at<GenericStructProperty>(MASS_FRAME);
if(!frame_prop) { if(!frame_prop) {
_state = State::Invalid; _state = State::Invalid;
@ -80,81 +81,81 @@ auto Mass::writeJointSliders() -> bool {
Containers::Array<UnrealPropertyBase::ptr> temp; Containers::Array<UnrealPropertyBase::ptr> temp;
auto length = frame_prop->atMove<FloatProperty>("NeckLength_6_ED6AF79849C27CD1A9D523A09E2BFE58"_s); auto length = frame_prop->atMove<FloatProperty>(MASS_JOINT_NECK);
if(_frame.joints.neck != 0.0f) { if(_frame.joints.neck != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("NeckLength_6_ED6AF79849C27CD1A9D523A09E2BFE58"_s); length->name.emplace(MASS_JOINT_NECK);
} }
length->value = _frame.joints.neck; length->value = _frame.joints.neck;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("BodyLength_7_C16287754CBA96C93BAE36A5C154996A"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_BODY);
if(_frame.joints.body != 0.0f) { if(_frame.joints.body != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("BodyLength_7_C16287754CBA96C93BAE36A5C154996A"_s); length->name.emplace(MASS_JOINT_BODY);
} }
length->value = _frame.joints.body; length->value = _frame.joints.body;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("ShoulderLength_8_220EDF304F1C1226F0D8D39117FB3883"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_SHOULDER);
if(_frame.joints.shoulders != 0.0f) { if(_frame.joints.shoulders != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("ShoulderLength_8_220EDF304F1C1226F0D8D39117FB3883"_s); length->name.emplace(MASS_JOINT_SHOULDER);
} }
length->value = _frame.joints.shoulders; length->value = _frame.joints.shoulders;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("ArmUpperLength_10_249FDA3E4F3B399E7B9E5C9B7C765EAE"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_ARM_UPPER);
if(_frame.joints.upperArms != 0.0f) { if(_frame.joints.upperArms != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("ArmUpperLength_10_249FDA3E4F3B399E7B9E5C9B7C765EAE"_s); length->name.emplace(MASS_JOINT_ARM_UPPER);
} }
length->value = _frame.joints.upperArms; length->value = _frame.joints.upperArms;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("ArmLowerLength_12_ACD0F02745C28882619376926292FB36"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_ARM_LOWER);
if(_frame.joints.lowerArms != 0.0f) { if(_frame.joints.lowerArms != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("ArmLowerLength_12_ACD0F02745C28882619376926292FB36"_s); length->name.emplace(MASS_JOINT_ARM_LOWER);
} }
length->value = _frame.joints.lowerArms; length->value = _frame.joints.lowerArms;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("HipLength_14_02AEEEAC4376087B9C51F0AA7CC92818"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_HIP);
if(_frame.joints.hips != 0.0f) { if(_frame.joints.hips != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("HipLength_14_02AEEEAC4376087B9C51F0AA7CC92818"_s); length->name.emplace(MASS_JOINT_HIP);
} }
length->value = _frame.joints.hips; length->value = _frame.joints.hips;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("LegUpperLength_16_A7C4C71249A3776F7A543D96819C0C61"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_LEG_UPPER);
if(_frame.joints.upperLegs != 0.0f) { if(_frame.joints.upperLegs != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("LegUpperLength_16_A7C4C71249A3776F7A543D96819C0C61"_s); length->name.emplace(MASS_JOINT_LEG_UPPER);
} }
length->value = _frame.joints.upperLegs; length->value = _frame.joints.upperLegs;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
} }
length = frame_prop->atMove<FloatProperty>("LegLowerLength_18_D2DF39964EA0F2A2129D0491B08A032F"_s); length = frame_prop->atMove<FloatProperty>(MASS_JOINT_LEG_LOWER);
if(_frame.joints.lowerLegs != 0.0f) { if(_frame.joints.lowerLegs != 0.0f) {
if(!length) { if(!length) {
length.emplace(); length.emplace();
length->name.emplace("LegLowerLength_18_D2DF39964EA0F2A2129D0491B08A032F"_s); length->name.emplace(MASS_JOINT_LEG_LOWER);
} }
length->value = _frame.joints.lowerLegs; length->value = _frame.joints.lowerLegs;
arrayAppend(temp, std::move(length)); arrayAppend(temp, std::move(length));
@ -179,21 +180,21 @@ auto Mass::frameStyles() -> Containers::ArrayView<Int> {
} }
void Mass::getFrameStyles() { void Mass::getFrameStyles() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Can't find unit data in" << _filename; Utility::Error{} << "Can't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto frame_prop = unit_data->at<GenericStructProperty>("Frame_3_F92B0F6A44A15088AF7F41B9FF290653"_s); auto frame_prop = unit_data->at<GenericStructProperty>(MASS_FRAME);
if(!frame_prop) { if(!frame_prop) {
Utility::Error{} << "Can't find frame data in" << _filename; Utility::Error{} << "Can't find frame data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto frame_styles = frame_prop->at<ArrayProperty>("Styles_32_00A3B3284B37F1E7819458844A20EB48"_s); auto frame_styles = frame_prop->at<ArrayProperty>(MASS_FRAME_STYLES);
if(!frame_styles) { if(!frame_styles) {
Utility::Error{} << "Can't find frame styles in" << _filename; Utility::Error{} << "Can't find frame styles in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -212,21 +213,21 @@ void Mass::getFrameStyles() {
} }
auto Mass::writeFrameStyles() -> bool { auto Mass::writeFrameStyles() -> bool {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data in "_s + _filename; _lastError = "No unit data in "_s + _filename;
return false; return false;
} }
auto frame = unit_data->at<GenericStructProperty>("Frame_3_F92B0F6A44A15088AF7F41B9FF290653"_s); auto frame = unit_data->at<GenericStructProperty>(MASS_FRAME);
if(!frame) { if(!frame) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No frame data in "_s + _filename; _lastError = "No frame data in "_s + _filename;
return false; return false;
} }
auto frame_styles = frame->at<ArrayProperty>("Styles_32_00A3B3284B37F1E7819458844A20EB48"_s); auto frame_styles = frame->at<ArrayProperty>(MASS_FRAME_STYLES);
if(!frame_styles) { if(!frame_styles) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No frame styles in "_s + _filename; _lastError = "No frame styles in "_s + _filename;
@ -250,21 +251,21 @@ auto Mass::eyeFlareColour() -> Color4& {
} }
void Mass::getEyeFlareColour() { void Mass::getEyeFlareColour() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Can't find unit data in" << _filename; Utility::Error{} << "Can't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto frame_prop = unit_data->at<GenericStructProperty>("Frame_3_F92B0F6A44A15088AF7F41B9FF290653"_s); auto frame_prop = unit_data->at<GenericStructProperty>(MASS_FRAME);
if(!frame_prop) { if(!frame_prop) {
Utility::Error{} << "Can't find frame data in" << _filename; Utility::Error{} << "Can't find frame data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto eye_flare_prop = frame_prop->at<ColourStructProperty>("EyeFlareColor_36_AF79999C40FCA0E88A2F9A84488A38CA"_s); auto eye_flare_prop = frame_prop->at<ColourStructProperty>(MASS_EYE_FLARE);
if(!eye_flare_prop) { if(!eye_flare_prop) {
Utility::Error{} << "Can't find eye flare data in" << _filename; Utility::Error{} << "Can't find eye flare data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -275,21 +276,21 @@ void Mass::getEyeFlareColour() {
} }
auto Mass::writeEyeFlareColour() -> bool { auto Mass::writeEyeFlareColour() -> bool {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data in "_s + _filename; _lastError = "No unit data in "_s + _filename;
return false; return false;
} }
auto frame = unit_data->at<GenericStructProperty>("Frame_3_F92B0F6A44A15088AF7F41B9FF290653"_s); auto frame = unit_data->at<GenericStructProperty>(MASS_FRAME);
if(!frame) { if(!frame) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No frame data in "_s + _filename; _lastError = "No frame data in "_s + _filename;
return false; return false;
} }
auto eye_flare_prop = frame->at<ColourStructProperty>("EyeFlareColor_36_AF79999C40FCA0E88A2F9A84488A38CA"_s); auto eye_flare_prop = frame->at<ColourStructProperty>(MASS_EYE_FLARE);
if(!eye_flare_prop) { if(!eye_flare_prop) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No eye flare property in "_s + _filename; _lastError = "No eye flare property in "_s + _filename;
@ -314,14 +315,14 @@ auto Mass::frameCustomStyles() -> Containers::ArrayView<CustomStyle> {
} }
void Mass::getFrameCustomStyles() { void Mass::getFrameCustomStyles() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Can't find unit data in" << _filename; Utility::Error{} << "Can't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto frame_styles = unit_data->at<ArrayProperty>("FrameStyle_44_04A44C9440363CCEC5443D98BFAF22AA"_s); auto frame_styles = unit_data->at<ArrayProperty>(MASS_CUSTOM_FRAME_STYLES);
if(!frame_styles) { if(!frame_styles) {
Utility::Error{} << "Can't find frame styles in" << _filename; Utility::Error{} << "Can't find frame styles in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -343,14 +344,14 @@ auto Mass::writeFrameCustomStyle(UnsignedLong index) -> bool {
return false; return false;
} }
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data in "_s + _filename; _lastError = "No unit data in "_s + _filename;
return false; return false;
} }
auto frame_styles = unit_data->at<ArrayProperty>("FrameStyle_44_04A44C9440363CCEC5443D98BFAF22AA"_s); auto frame_styles = unit_data->at<ArrayProperty>(MASS_CUSTOM_FRAME_STYLES);
if(!frame_styles) { if(!frame_styles) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No frame styles in "_s + _filename; _lastError = "No frame styles in "_s + _filename;

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "PropertyNames.h"
#include "../UESaveFile/Types/ArrayProperty.h" #include "../UESaveFile/Types/ArrayProperty.h"
#include "../UESaveFile/Types/ColourStructProperty.h" #include "../UESaveFile/Types/ColourStructProperty.h"
#include "../UESaveFile/Types/FloatProperty.h" #include "../UESaveFile/Types/FloatProperty.h"
@ -30,14 +31,14 @@ auto Mass::globalStyles() -> Containers::ArrayView<CustomStyle> {
} }
void Mass::getGlobalStyles() { void Mass::getGlobalStyles() {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Can't find unit data in" << _filename; Utility::Error{} << "Can't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
return; return;
} }
auto global_styles = unit_data->at<ArrayProperty>("GlobalStyles_57_6A681C114035241F7BDAAE9B43A8BF1B"_s); auto global_styles = unit_data->at<ArrayProperty>(MASS_GLOBAL_STYLES);
if(!global_styles) { if(!global_styles) {
_globalStyles = Containers::Array<CustomStyle>{0}; _globalStyles = Containers::Array<CustomStyle>{0};
return; return;
@ -56,14 +57,14 @@ auto Mass::writeGlobalStyle(UnsignedLong index) -> bool {
return false; return false;
} }
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data found in "_s + _filename; _lastError = "No unit data found in "_s + _filename;
return false; return false;
} }
auto global_styles = unit_data->at<ArrayProperty>("GlobalStyles_57_6A681C114035241F7BDAAE9B43A8BF1B"_s); auto global_styles = unit_data->at<ArrayProperty>(MASS_GLOBAL_STYLES);
if(!global_styles) { if(!global_styles) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No global styles found in "_s + _filename; _lastError = "No global styles found in "_s + _filename;
@ -78,21 +79,21 @@ void Mass::getCustomStyles(Containers::ArrayView<CustomStyle> styles, ArrayPrope
auto style_prop = style_array->at<GenericStructProperty>(i); auto style_prop = style_array->at<GenericStructProperty>(i);
auto& style = styles[i]; auto& style = styles[i];
style.name = style_prop->at<StringProperty>("Name_27_1532115A46EF2B2FA283908DF561A86B"_s)->value; style.name = style_prop->at<StringProperty>(MASS_STYLE_NAME)->value;
auto colour_prop = style_prop->at<ColourStructProperty>("Color_5_F0D383DF40474C9464AE48A0984A212E"_s); auto colour_prop = style_prop->at<ColourStructProperty>(MASS_STYLE_COLOUR);
style.colour = Color4{colour_prop->r, colour_prop->g, colour_prop->b, colour_prop->a}; style.colour = Color4{colour_prop->r, colour_prop->g, colour_prop->b, colour_prop->a};
style.metallic = style_prop->at<FloatProperty>("Metallic_10_0A4CD1E4482CBF41CA61D0A856DE90B9"_s)->value;
style.gloss = style_prop->at<FloatProperty>("Gloss_11_9769599842CC275A401C4282A236E240"_s)->value;
style.glow = colour_prop->a == 0.0f ? false : true; style.glow = colour_prop->a == 0.0f ? false : true;
style.metallic = style_prop->at<FloatProperty>(MASS_STYLE_METALLIC)->value;
style.gloss = style_prop->at<FloatProperty>(MASS_STYLE_GLOSS)->value;
style.patternId = style_prop->at<IntProperty>("PatternID_14_516DB85641DAF8ECFD2920BE2BDF1311"_s)->value; style.patternId = style_prop->at<IntProperty>(MASS_STYLE_PATTERN_ID)->value;
style.opacity = style_prop->at<FloatProperty>("Opacity_30_53BD060B4DFCA1C92302D6A0F7831131"_s)->value; style.opacity = style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_OPACITY)->value;
style.offset = Vector2{ style.offset = Vector2{
style_prop->at<FloatProperty>("OffsetX_23_70FC2E814C64BBB82452748D2AF9CD48"_s)->value, style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_OFFSETX)->value,
style_prop->at<FloatProperty>("OffsetY_24_5E1F866C4C054D9B2EE337ADC180C17F"_s)->value style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_OFFSETY)->value
}; };
style.rotation = style_prop->at<FloatProperty>("Rotation_25_EC2DFAD84AD0A6BD3FA841ACD52EDD6D"_s)->value; style.rotation = style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_ROTATION)->value;
style.scale = style_prop->at<FloatProperty>("Scale_26_19DF0708409262183E1247B317137671"_s)->value; style.scale = style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_SCALE)->value;
} }
} }
@ -103,27 +104,26 @@ auto Mass::writeCustomStyle(const CustomStyle& style, UnsignedLong index, ArrayP
} }
auto style_prop = style_array->at<GenericStructProperty>(index); auto style_prop = style_array->at<GenericStructProperty>(index);
if(!style_prop) { if(!style_prop) {
_lastError = "Style index is out of range in "_s + _filename; _lastError = "Style index is out of range in "_s + _filename;
return false; return false;
} }
style_prop->at<StringProperty>("Name_27_1532115A46EF2B2FA283908DF561A86B"_s)->value = style.name; style_prop->at<StringProperty>(MASS_STYLE_NAME)->value = style.name;
auto colour_prop = style_prop->at<ColourStructProperty>("Color_5_F0D383DF40474C9464AE48A0984A212E"_s); auto colour_prop = style_prop->at<ColourStructProperty>(MASS_STYLE_COLOUR);
colour_prop->r = style.colour.r(); colour_prop->r = style.colour.r();
colour_prop->g = style.colour.g(); colour_prop->g = style.colour.g();
colour_prop->b = style.colour.b(); colour_prop->b = style.colour.b();
colour_prop->a = style.glow ? 1.0f : 0.0f; colour_prop->a = style.glow ? 1.0f : 0.0f;
style_prop->at<FloatProperty>("Metallic_10_0A4CD1E4482CBF41CA61D0A856DE90B9"_s)->value = style.metallic; style_prop->at<FloatProperty>(MASS_STYLE_METALLIC)->value = style.metallic;
style_prop->at<FloatProperty>("Gloss_11_9769599842CC275A401C4282A236E240"_s)->value = style.gloss; style_prop->at<FloatProperty>(MASS_STYLE_GLOSS)->value = style.gloss;
style_prop->at<IntProperty>("PatternID_14_516DB85641DAF8ECFD2920BE2BDF1311"_s)->value = style.patternId; style_prop->at<IntProperty>(MASS_STYLE_PATTERN_ID)->value = style.patternId;
style_prop->at<FloatProperty>("Opacity_30_53BD060B4DFCA1C92302D6A0F7831131"_s)->value = style.opacity; style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_OPACITY)->value = style.opacity;
style_prop->at<FloatProperty>("OffsetX_23_70FC2E814C64BBB82452748D2AF9CD48"_s)->value = style.offset.x(); style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_OFFSETX)->value = style.offset.x();
style_prop->at<FloatProperty>("OffsetY_24_5E1F866C4C054D9B2EE337ADC180C17F"_s)->value = style.offset.y(); style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_OFFSETY)->value = style.offset.y();
style_prop->at<FloatProperty>("Rotation_25_EC2DFAD84AD0A6BD3FA841ACD52EDD6D"_s)->value = style.rotation; style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_ROTATION)->value = style.rotation;
style_prop->at<FloatProperty>("Scale_26_19DF0708409262183E1247B317137671"_s)->value = style.scale; style_prop->at<FloatProperty>(MASS_STYLE_PATTERN_SCALE)->value = style.scale;
if(!_mass->saveToFile()) { if(!_mass->saveToFile()) {
_lastError = _mass->lastError(); _lastError = _mass->lastError();

View file

@ -31,11 +31,11 @@ auto Mass::meleeWeapons() -> Containers::ArrayView<Weapon> {
} }
void Mass::getMeleeWeapons() { void Mass::getMeleeWeapons() {
getWeaponType("WeaponCC_22_0BBEC58C4A0EA1DB9E037B9339EE26A7"_s, _weapons.melee); getWeaponType(MASS_WEAPONS_MELEE, _weapons.melee);
} }
auto Mass::writeMeleeWeapons() -> bool { auto Mass::writeMeleeWeapons() -> bool {
return writeWeaponType("WeaponCC_22_0BBEC58C4A0EA1DB9E037B9339EE26A7"_s, _weapons.melee); return writeWeaponType(MASS_WEAPONS_MELEE, _weapons.melee);
} }
auto Mass::shields() -> Containers::ArrayView<Weapon> { auto Mass::shields() -> Containers::ArrayView<Weapon> {
@ -43,11 +43,11 @@ auto Mass::shields() -> Containers::ArrayView<Weapon> {
} }
void Mass::getShields() { void Mass::getShields() {
getWeaponType("Shield_53_839BFD7945481BAEA3E43A9C5CA8E92E"_s, _weapons.shields); getWeaponType(MASS_WEAPONS_SHIELD, _weapons.shields);
} }
auto Mass::writeShields() -> bool { auto Mass::writeShields() -> bool {
return writeWeaponType("Shield_53_839BFD7945481BAEA3E43A9C5CA8E92E"_s, _weapons.shields); return writeWeaponType(MASS_WEAPONS_SHIELD, _weapons.shields);
} }
auto Mass::bulletShooters() -> Containers::ArrayView<Weapon> { auto Mass::bulletShooters() -> Containers::ArrayView<Weapon> {
@ -55,11 +55,11 @@ auto Mass::bulletShooters() -> Containers::ArrayView<Weapon> {
} }
void Mass::getBulletShooters() { void Mass::getBulletShooters() {
getWeaponType("WeaponBS_35_6EF6E0104FD7A138DF47F88CB57A83ED"_s, _weapons.bulletShooters); getWeaponType(MASS_WEAPONS_BSHOOTER, _weapons.bulletShooters);
} }
auto Mass::writeBulletShooters() -> bool { auto Mass::writeBulletShooters() -> bool {
return writeWeaponType("WeaponBS_35_6EF6E0104FD7A138DF47F88CB57A83ED"_s, _weapons.bulletShooters); return writeWeaponType(MASS_WEAPONS_BSHOOTER, _weapons.bulletShooters);
} }
auto Mass::energyShooters() -> Containers::ArrayView<Weapon> { auto Mass::energyShooters() -> Containers::ArrayView<Weapon> {
@ -67,11 +67,11 @@ auto Mass::energyShooters() -> Containers::ArrayView<Weapon> {
} }
void Mass::getEnergyShooters() { void Mass::getEnergyShooters() {
getWeaponType("WeaponES_37_1A295D544528623880A0B1AC2C7DEE99"_s, _weapons.energyShooters); getWeaponType(MASS_WEAPONS_ESHOOTER, _weapons.energyShooters);
} }
auto Mass::writeEnergyShooters() -> bool { auto Mass::writeEnergyShooters() -> bool {
return writeWeaponType("WeaponES_37_1A295D544528623880A0B1AC2C7DEE99"_s, _weapons.energyShooters); return writeWeaponType(MASS_WEAPONS_ESHOOTER, _weapons.energyShooters);
} }
auto Mass::bulletLaunchers() -> Containers::ArrayView<Weapon> { auto Mass::bulletLaunchers() -> Containers::ArrayView<Weapon> {
@ -79,11 +79,11 @@ auto Mass::bulletLaunchers() -> Containers::ArrayView<Weapon> {
} }
void Mass::getBulletLaunchers() { void Mass::getBulletLaunchers() {
getWeaponType("WeaponBL_36_5FD7C41E4613A75B44AB0E90B362846E"_s, _weapons.bulletLaunchers); getWeaponType(MASS_WEAPONS_BLAUNCHER, _weapons.bulletLaunchers);
} }
auto Mass::writeBulletLaunchers() -> bool { auto Mass::writeBulletLaunchers() -> bool {
return writeWeaponType("WeaponBL_36_5FD7C41E4613A75B44AB0E90B362846E"_s, _weapons.bulletLaunchers); return writeWeaponType(MASS_WEAPONS_BLAUNCHER, _weapons.bulletLaunchers);
} }
auto Mass::energyLaunchers() -> Containers::ArrayView<Weapon> { auto Mass::energyLaunchers() -> Containers::ArrayView<Weapon> {
@ -91,15 +91,15 @@ auto Mass::energyLaunchers() -> Containers::ArrayView<Weapon> {
} }
void Mass::getEnergyLaunchers() { void Mass::getEnergyLaunchers() {
getWeaponType("WeaponEL_38_9D23F3884ACA15902C9E6CA6E4995995"_s, _weapons.energyLaunchers); getWeaponType(MASS_WEAPONS_ELAUNCHER, _weapons.energyLaunchers);
} }
auto Mass::writeEnergyLaunchers() -> bool { auto Mass::writeEnergyLaunchers() -> bool {
return writeWeaponType("WeaponEL_38_9D23F3884ACA15902C9E6CA6E4995995"_s, _weapons.energyLaunchers); return writeWeaponType(MASS_WEAPONS_ELAUNCHER, _weapons.energyLaunchers);
} }
void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView<Weapon> weapon_array) { void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView<Weapon> weapon_array) {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
Utility::Error{} << "Can't find unit data in" << _filename; Utility::Error{} << "Can't find unit data in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -123,8 +123,8 @@ void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView
auto weapon_prop = prop->at<GenericStructProperty>(i); auto weapon_prop = prop->at<GenericStructProperty>(i);
auto& weapon = weapon_array[i]; auto& weapon = weapon_array[i];
weapon.name = weapon_prop->at<StringProperty>("Name_13_7BF0D31F4E50C50C47231BB36A485D92"_s)->value; weapon.name = weapon_prop->at<StringProperty>(MASS_WEAPON_NAME)->value;
auto& weapon_type = weapon_prop->at<ByteProperty>("Type_2_35ABA8C3406F8D9BBF14A89CD6BCE976"_s)->enumValue; auto& weapon_type = weapon_prop->at<ByteProperty>(MASS_WEAPON_TYPE)->enumValue;
#define c(enumerator, strenum, name) if(weapon_type == (strenum)) { weapon.type = WeaponType::enumerator; } else #define c(enumerator, strenum, name) if(weapon_type == (strenum)) { weapon.type = WeaponType::enumerator; } else
#include "../Maps/WeaponTypes.hpp" #include "../Maps/WeaponTypes.hpp"
#undef c #undef c
@ -133,28 +133,28 @@ void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView
Utility::Warning{} << "Invalid weapon type enum value in getWeaponType()."_s; Utility::Warning{} << "Invalid weapon type enum value in getWeaponType()."_s;
} }
auto parts_prop = weapon_prop->at<ArrayProperty>("Element_6_8E4617CC4B2C1F1490435599784EC6E0"_s); auto parts_prop = weapon_prop->at<ArrayProperty>(MASS_WEAPON_ELEMENT);
weapon.parts = Containers::Array<WeaponPart>{ValueInit, parts_prop->items.size()}; weapon.parts = Containers::Array<WeaponPart>{ValueInit, parts_prop->items.size()};
for(UnsignedInt j = 0; j < parts_prop->items.size(); j++) { for(UnsignedInt j = 0; j < parts_prop->items.size(); j++) {
auto part_prop = parts_prop->at<GenericStructProperty>(j); auto part_prop = parts_prop->at<GenericStructProperty>(j);
auto& part = weapon.parts[j]; auto& part = weapon.parts[j];
part.id = part_prop->at<IntProperty>("ID_2_A74D75434308158E5926178822DD28EE"_s)->value; part.id = part_prop->at<IntProperty>(MASS_WEAPON_PART_ID)->value;
auto part_styles = part_prop->at<ArrayProperty>("Styles_17_994C97C34A90667BE5B716BFD0B97588"_s); auto part_styles = part_prop->at<ArrayProperty>(MASS_WEAPON_PART_STYLES);
for(UnsignedInt k = 0; k < part_styles->items.size(); k++) { for(UnsignedInt k = 0; k < part_styles->items.size(); k++) {
part.styles[k] = part_styles->at<IntProperty>(k)->value; part.styles[k] = part_styles->at<IntProperty>(k)->value;
} }
auto part_decals = part_prop->at<ArrayProperty>("Decals_13_8B81112B453D7230C0CDE982185E14F1"_s); auto part_decals = part_prop->at<ArrayProperty>(MASS_WEAPON_PART_DECALS);
if(part_decals->items.size() != part.decals.size()) { if(part_decals->items.size() != part.decals.size()) {
part.decals = Containers::Array<Decal>{part_decals->items.size()}; part.decals = Containers::Array<Decal>{part_decals->items.size()};
} }
getDecals(part.decals, part_decals); getDecals(part.decals, part_decals);
auto part_accs = part_prop->at<ArrayProperty>("Accessories_21_3878DE8B4ED0EA0DB725E98BCDC20E0C"_s); auto part_accs = part_prop->at<ArrayProperty>(MASS_WEAPON_PART_ACCESSORIES);
if(!part_accs) { if(!part_accs) {
part.accessories = Containers::Array<Accessory>{0}; part.accessories = Containers::Array<Accessory>{0};
continue; continue;
@ -166,7 +166,7 @@ void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView
getAccessories(part.accessories, part_accs); getAccessories(part.accessories, part_accs);
} }
auto custom_styles = weapon_prop->at<ArrayProperty>("Styles_10_8C3C82444B986AD7A99595AD4985912D"_s); auto custom_styles = weapon_prop->at<ArrayProperty>(MASS_CUSTOM_WEAPON_STYLES);
if(!custom_styles) { if(!custom_styles) {
Utility::Error{} << "Can't find weapon custom styles in" << _filename; Utility::Error{} << "Can't find weapon custom styles in" << _filename;
_state = State::Invalid; _state = State::Invalid;
@ -181,8 +181,8 @@ void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView
getCustomStyles(weapon.customStyles, custom_styles); getCustomStyles(weapon.customStyles, custom_styles);
weapon.attached = weapon_prop->at<BoolProperty>("Attach_15_D00AABBD4AD6A04778D56D81E51927B3"_s)->value; weapon.attached = weapon_prop->at<BoolProperty>(MASS_WEAPON_ATTACH)->value;
auto& damage_type = weapon_prop->at<ByteProperty>("DamageType_18_E1FFA53540591A9087EC698117A65C83"_s)->enumValue; auto& damage_type = weapon_prop->at<ByteProperty>(MASS_WEAPON_DAMAGE_TYPE)->enumValue;
#define c(enumerator, strenum) if(damage_type == (strenum)) { weapon.damageType = DamageType::enumerator; } else #define c(enumerator, strenum) if(damage_type == (strenum)) { weapon.damageType = DamageType::enumerator; } else
#include "../Maps/DamageTypes.hpp" #include "../Maps/DamageTypes.hpp"
#undef c #undef c
@ -190,8 +190,8 @@ void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView
_state = State::Invalid; _state = State::Invalid;
Utility::Warning{} << "Invalid damage type enum value in getWeaponType()."_s; Utility::Warning{} << "Invalid damage type enum value in getWeaponType()."_s;
} }
weapon.dualWield = weapon_prop->at<BoolProperty>("DualWield_20_B2EB2CEA4A6A233DC7575996B6DD1222"_s)->value; weapon.dualWield = weapon_prop->at<BoolProperty>(MASS_WEAPON_DUAL_WIELD)->value;
auto& effect_colour_mode = weapon_prop->at<ByteProperty>("ColorEfxMode_24_D254BCF943E852BF9ADB8AAA8FD80014"_s)->enumValue; auto& effect_colour_mode = weapon_prop->at<ByteProperty>(MASS_WEAPON_COLOUR_EFX_MODE)->enumValue;
#define c(enumerator, strenum) if(effect_colour_mode == (strenum)) { weapon.effectColourMode = EffectColourMode::enumerator; } else #define c(enumerator, strenum) if(effect_colour_mode == (strenum)) { weapon.effectColourMode = EffectColourMode::enumerator; } else
#include "../Maps/EffectColourModes.hpp" #include "../Maps/EffectColourModes.hpp"
#undef c #undef c
@ -199,13 +199,13 @@ void Mass::getWeaponType(Containers::StringView prop_name, Containers::ArrayView
_state = State::Invalid; _state = State::Invalid;
Utility::Warning{} << "Invalid effect colour mode in getWeaponType()."_s; Utility::Warning{} << "Invalid effect colour mode in getWeaponType()."_s;
} }
auto effect_colour = weapon_prop->at<ColourStructProperty>("ColorEfx_26_D921B62946C493E487455A831F4520AC"_s); auto effect_colour = weapon_prop->at<ColourStructProperty>(MASS_WEAPON_COLOUR_EFX);
weapon.effectColour = Color4{effect_colour->r, effect_colour->g, effect_colour->b, effect_colour->a}; weapon.effectColour = Color4{effect_colour->r, effect_colour->g, effect_colour->b, effect_colour->a};
} }
} }
auto Mass::writeWeaponType(Containers::StringView prop_name, Containers::ArrayView<Weapon> weapon_array) -> bool { auto Mass::writeWeaponType(Containers::StringView prop_name, Containers::ArrayView<Weapon> weapon_array) -> bool {
auto unit_data = _mass->at<GenericStructProperty>("UnitData"_s); auto unit_data = _mass->at<GenericStructProperty>(MASS_UNIT_DATA);
if(!unit_data) { if(!unit_data) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No unit data in "_s + _filename; _lastError = "No unit data in "_s + _filename;
@ -229,16 +229,16 @@ auto Mass::writeWeaponType(Containers::StringView prop_name, Containers::ArrayVi
auto weapon_prop = prop->at<GenericStructProperty>(i); auto weapon_prop = prop->at<GenericStructProperty>(i);
auto& weapon = weapon_array[i]; auto& weapon = weapon_array[i];
weapon_prop->at<StringProperty>("Name_13_7BF0D31F4E50C50C47231BB36A485D92"_s)->value = weapon.name; weapon_prop->at<StringProperty>(MASS_WEAPON_NAME)->value = weapon.name;
switch(weapon.type) { switch(weapon.type) {
#define c(enumerator, strenum, name) case WeaponType::enumerator: weapon_prop->at<ByteProperty>("Type_2_35ABA8C3406F8D9BBF14A89CD6BCE976"_s)->enumValue = strenum; break; #define c(enumerator, strenum, name) case WeaponType::enumerator: weapon_prop->at<ByteProperty>(MASS_WEAPON_TYPE)->enumValue = strenum; break;
#include "../Maps/WeaponTypes.hpp" #include "../Maps/WeaponTypes.hpp"
#undef c #undef c
default: default:
Utility::Warning{} << "Invalid weapon type enum value in writeWeaponType()."_s; Utility::Warning{} << "Invalid weapon type enum value in writeWeaponType()."_s;
} }
auto parts_prop = weapon_prop->at<ArrayProperty>("Element_6_8E4617CC4B2C1F1490435599784EC6E0"_s); auto parts_prop = weapon_prop->at<ArrayProperty>(MASS_WEAPON_ELEMENT);
if(parts_prop->items.size() != weapon.parts.size()) { if(parts_prop->items.size() != weapon.parts.size()) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "Weapon parts array size mismatch."_s; _lastError = "Weapon parts array size mismatch."_s;
@ -249,17 +249,17 @@ auto Mass::writeWeaponType(Containers::StringView prop_name, Containers::ArrayVi
auto part_prop = parts_prop->at<GenericStructProperty>(j); auto part_prop = parts_prop->at<GenericStructProperty>(j);
auto& part = weapon.parts[j]; auto& part = weapon.parts[j];
part_prop->at<IntProperty>("ID_2_A74D75434308158E5926178822DD28EE"_s)->value = part.id; part_prop->at<IntProperty>(MASS_WEAPON_PART_ID)->value = part.id;
auto part_styles = part_prop->at<ArrayProperty>("Styles_17_994C97C34A90667BE5B716BFD0B97588"_s); auto part_styles = part_prop->at<ArrayProperty>(MASS_WEAPON_PART_STYLES);
for(UnsignedInt k = 0; k < part_styles->items.size(); k++) { for(UnsignedInt k = 0; k < part_styles->items.size(); k++) {
part_styles->at<IntProperty>(k)->value = part.styles[k]; part_styles->at<IntProperty>(k)->value = part.styles[k];
} }
auto part_decals = part_prop->at<ArrayProperty>("Decals_13_8B81112B453D7230C0CDE982185E14F1"_s); auto part_decals = part_prop->at<ArrayProperty>(MASS_WEAPON_PART_DECALS);
writeDecals(part.decals, part_decals); writeDecals(part.decals, part_decals);
auto part_accs = part_prop->at<ArrayProperty>("Accessories_21_3878DE8B4ED0EA0DB725E98BCDC20E0C"_s); auto part_accs = part_prop->at<ArrayProperty>(MASS_WEAPON_PART_ACCESSORIES);
if(!part_accs) { if(!part_accs) {
continue; continue;
} }
@ -273,7 +273,7 @@ auto Mass::writeWeaponType(Containers::StringView prop_name, Containers::ArrayVi
writeAccessories(part.accessories, part_accs); writeAccessories(part.accessories, part_accs);
} }
auto custom_styles = weapon_prop->at<ArrayProperty>("Styles_10_8C3C82444B986AD7A99595AD4985912D"_s); auto custom_styles = weapon_prop->at<ArrayProperty>(MASS_CUSTOM_WEAPON_STYLES);
if(!custom_styles) { if(!custom_styles) {
_state = State::Invalid; _state = State::Invalid;
_lastError = "No custom styles found for weapon."_s; _lastError = "No custom styles found for weapon."_s;
@ -290,25 +290,25 @@ auto Mass::writeWeaponType(Containers::StringView prop_name, Containers::ArrayVi
writeCustomStyle(weapon.customStyles[j], j, custom_styles); writeCustomStyle(weapon.customStyles[j], j, custom_styles);
} }
weapon_prop->at<BoolProperty>("Attach_15_D00AABBD4AD6A04778D56D81E51927B3"_s)->value = weapon.attached; weapon_prop->at<BoolProperty>(MASS_WEAPON_ATTACH)->value = weapon.attached;
switch(weapon.damageType) { switch(weapon.damageType) {
#define c(enumerator, strenum) case DamageType::enumerator: weapon_prop->at<ByteProperty>("DamageType_18_E1FFA53540591A9087EC698117A65C83"_s)->enumValue = strenum; break; #define c(enumerator, strenum) case DamageType::enumerator: weapon_prop->at<ByteProperty>(MASS_WEAPON_DAMAGE_TYPE)->enumValue = strenum; break;
#include "../Maps/DamageTypes.hpp" #include "../Maps/DamageTypes.hpp"
#undef c #undef c
default: default:
Utility::Warning{} << "Unknown damage type enum value in writeWeaponType()."_s; Utility::Warning{} << "Unknown damage type enum value in writeWeaponType()."_s;
} }
weapon_prop->at<BoolProperty>("DualWield_20_B2EB2CEA4A6A233DC7575996B6DD1222"_s)->value = weapon.dualWield; weapon_prop->at<BoolProperty>(MASS_WEAPON_DUAL_WIELD)->value = weapon.dualWield;
switch(weapon.effectColourMode) { switch(weapon.effectColourMode) {
#define c(enumerator, enumstr) case EffectColourMode::enumerator: \ #define c(enumerator, enumstr) case EffectColourMode::enumerator: \
weapon_prop->at<ByteProperty>("ColorEfxMode_24_D254BCF943E852BF9ADB8AAA8FD80014"_s)->enumValue = enumstr; \ weapon_prop->at<ByteProperty>(MASS_WEAPON_COLOUR_EFX_MODE)->enumValue = enumstr; \
break; break;
#include "../Maps/EffectColourModes.hpp" #include "../Maps/EffectColourModes.hpp"
#undef c #undef c
default: default:
Utility::Warning{} << "Unknown effect colour mode in writeWeaponType()."_s; Utility::Warning{} << "Unknown effect colour mode in writeWeaponType()."_s;
} }
auto effect_colour = weapon_prop->at<ColourStructProperty>("ColorEfx_26_D921B62946C493E487455A831F4520AC"_s); auto effect_colour = weapon_prop->at<ColourStructProperty>(MASS_WEAPON_COLOUR_EFX);
effect_colour->r = weapon.effectColour.r(); effect_colour->r = weapon.effectColour.r();
effect_colour->g = weapon.effectColour.g(); effect_colour->g = weapon.effectColour.g();
effect_colour->b = weapon.effectColour.b(); effect_colour->b = weapon.effectColour.b();

104
src/Mass/PropertyNames.h Normal file
View file

@ -0,0 +1,104 @@
#pragma once
#define MASS_UNIT_DATA "UnitData"
#define MASS_NAME "Name_45_A037C5D54E53456407BDF091344529BB"
#define MASS_ACCOUNT "Account"
#define MASS_GLOBAL_STYLES "GlobalStyles_57_6A681C114035241F7BDAAE9B43A8BF1B"
// Frame stuff
#define MASS_FRAME "Frame_3_F92B0F6A44A15088AF7F41B9FF290653"
#define MASS_JOINT_NECK "NeckLength_6_ED6AF79849C27CD1A9D523A09E2BFE58"
#define MASS_JOINT_BODY "BodyLength_7_C16287754CBA96C93BAE36A5C154996A"
#define MASS_JOINT_SHOULDER "ShoulderLength_8_220EDF304F1C1226F0D8D39117FB3883"
#define MASS_JOINT_ARM_UPPER "ArmUpperLength_10_249FDA3E4F3B399E7B9E5C9B7C765EAE"
#define MASS_JOINT_ARM_LOWER "ArmLowerLength_12_ACD0F02745C28882619376926292FB36"
#define MASS_JOINT_HIP "HipLength_14_02AEEEAC4376087B9C51F0AA7CC92818"
#define MASS_JOINT_LEG_UPPER "LegUpperLength_16_A7C4C71249A3776F7A543D96819C0C61"
#define MASS_JOINT_LEG_LOWER "LegLowerLength_18_D2DF39964EA0F2A2129D0491B08A032F"
#define MASS_FRAME_STYLES "Styles_32_00A3B3284B37F1E7819458844A20EB48"
#define MASS_EYE_FLARE "EyeFlareColor_36_AF79999C40FCA0E88A2F9A84488A38CA"
#define MASS_CUSTOM_FRAME_STYLES "FrameStyle_44_04A44C9440363CCEC5443D98BFAF22AA"
// Armour stuff
#define MASS_ARMOUR_PARTS "Armor_10_12E266C44116DDAF57E99ABB575A4B3C"
#define MASS_ARMOUR_SLOT "Slot_3_408BA56F4C9605C7E805CF91B642249C"
#define MASS_ARMOUR_ID "ID_5_ACD101864D3481DE96EDACACC09BDD25"
#define MASS_ARMOUR_STYLES "Styles_47_3E31870441DFD7DB8BEE5C85C26B365B"
#define MASS_ARMOUR_DECALS "Decals_42_F358794A4F18497970F56BA9627D3603"
#define MASS_ARMOUR_ACCESSORIES "Accessories_52_D902DD4241FA0050C2529596255153F3"
#define MASS_CUSTOM_ARMOUR_STYLES "ArmorStyle_42_E2F6AC3647788CB366BD469B3B7E899E"
// Weapon stuff
#define MASS_WEAPONS_MELEE "WeaponCC_22_0BBEC58C4A0EA1DB9E037B9339EE26A7"
#define MASS_WEAPONS_SHIELD "Shield_53_839BFD7945481BAEA3E43A9C5CA8E92E"
#define MASS_WEAPONS_BSHOOTER "WeaponBS_35_6EF6E0104FD7A138DF47F88CB57A83ED"
#define MASS_WEAPONS_ESHOOTER "WeaponES_37_1A295D544528623880A0B1AC2C7DEE99"
#define MASS_WEAPONS_BLAUNCHER "WeaponBL_36_5FD7C41E4613A75B44AB0E90B362846E"
#define MASS_WEAPONS_ELAUNCHER "WeaponEL_38_9D23F3884ACA15902C9E6CA6E4995995"
#define MASS_WEAPON_NAME "Name_13_7BF0D31F4E50C50C47231BB36A485D92"
#define MASS_WEAPON_TYPE "Type_2_35ABA8C3406F8D9BBF14A89CD6BCE976"
#define MASS_WEAPON_ELEMENT "Element_6_8E4617CC4B2C1F1490435599784EC6E0"
#define MASS_CUSTOM_WEAPON_STYLES "Styles_10_8C3C82444B986AD7A99595AD4985912D"
#define MASS_WEAPON_ATTACH "Attach_15_D00AABBD4AD6A04778D56D81E51927B3"
#define MASS_WEAPON_DAMAGE_TYPE "DamageType_18_E1FFA53540591A9087EC698117A65C83"
#define MASS_WEAPON_DUAL_WIELD "DualWield_20_B2EB2CEA4A6A233DC7575996B6DD1222"
#define MASS_WEAPON_COLOUR_EFX_MODE "ColorEfxMode_24_D254BCF943E852BF9ADB8AAA8FD80014"
#define MASS_WEAPON_COLOUR_EFX "ColorEfx_26_D921B62946C493E487455A831F4520AC"
// Weapon part stuff
#define MASS_WEAPON_PART_ID "ID_2_A74D75434308158E5926178822DD28EE"
#define MASS_WEAPON_PART_STYLES "Styles_17_994C97C34A90667BE5B716BFD0B97588"
#define MASS_WEAPON_PART_DECALS "Decals_13_8B81112B453D7230C0CDE982185E14F1"
#define MASS_WEAPON_PART_ACCESSORIES "Accessories_21_3878DE8B4ED0EA0DB725E98BCDC20E0C"
// BL attachment stuff
#define MASS_BL_ATTACHMENT_STYLE "WeaponBLAttachmentStyle_65_5943FCE8406F18D2C3F69285EB23A699"
#define MASS_BL_ATTACHMENTS "WeaponBLAttachment_61_442D08F547510A4CEE1501BBAF297BA0"
#define MASS_BL_ATTACHMENT_SOCKET "Socket_9_B9DBF30D4A1F0032A2BE2F8B342B35A9"
#define MASS_BL_ATTACHMENT_RELLOC "RelativeLocation_10_2F6E75DF4C40622658340E9A22D38B02"
#define MASS_BL_ATTACHMENT_OFFLOC "OffsetLocation_11_F42B3DA3436948FF85752DB33722382F"
#define MASS_BL_ATTACHMENT_RELROT "RelativeRotation_12_578140464621245132CFF2A2AD85E735"
#define MASS_BL_ATTACHMENT_OFFROT "OffsetRotation_13_B5980BCD47905D842D1490A1A520B064"
#define MASS_BL_ATTACHMENT_RELSCALE "RelativeScale_16_37BC80EF42699F79533F7AA7B3094E38"
// Style stuff
#define MASS_STYLE_NAME "Name_27_1532115A46EF2B2FA283908DF561A86B"
#define MASS_STYLE_COLOUR "Color_5_F0D383DF40474C9464AE48A0984A212E"
#define MASS_STYLE_METALLIC "Metallic_10_0A4CD1E4482CBF41CA61D0A856DE90B9"
#define MASS_STYLE_GLOSS "Gloss_11_9769599842CC275A401C4282A236E240"
#define MASS_STYLE_PATTERN_ID "PatternID_14_516DB85641DAF8ECFD2920BE2BDF1311"
#define MASS_STYLE_PATTERN_OPACITY "Opacity_30_53BD060B4DFCA1C92302D6A0F7831131"
#define MASS_STYLE_PATTERN_OFFSETX "OffsetX_23_70FC2E814C64BBB82452748D2AF9CD48"
#define MASS_STYLE_PATTERN_OFFSETY "OffsetY_24_5E1F866C4C054D9B2EE337ADC180C17F"
#define MASS_STYLE_PATTERN_ROTATION "Rotation_25_EC2DFAD84AD0A6BD3FA841ACD52EDD6D"
#define MASS_STYLE_PATTERN_SCALE "Scale_26_19DF0708409262183E1247B317137671"
// Decal stuff
#define MASS_DECAL_ID "ID_3_694C0B35404D8A3168AEC89026BC8CF9"
#define MASS_DECAL_COLOUR "Color_8_1B0B9D2B43DA6AAB9FA549B374D3E606"
#define MASS_DECAL_POSITION "Position_41_022C8FE84E1AAFE587261E88F2C72250"
#define MASS_DECAL_UAXIS "UAxis_37_EBEB715F45491AECACCC07A1AE4646D1"
#define MASS_DECAL_VAXIS "VAxis_39_C31EB2664EE202CAECFBBB84100B5E35"
#define MASS_DECAL_OFFSET "Offset_29_B02BBBB74FC60F5EDBEBAB8020738020"
#define MASS_DECAL_SCALE "Scale_32_959D1C2747AFD8D62808468235CBBA40"
#define MASS_DECAL_ROTATION "Rotation_27_12D7C314493D203D5C2326A03C5F910F"
#define MASS_DECAL_FLIP "Flip_35_CECCFB184CCD9412BD93FE9A8B656BE1"
#define MASS_DECAL_WRAP "Wrap_43_A7C68CDF4A92AF2ECDA53F953EE7CA62"
// Accessory stuff
#define MASS_ACCESSORY_ATTACH_INDEX "AttachIndex_2_4AFCF6024E4BA7426C6B9F80B8179D20"
#define MASS_ACCESSORY_ID "ID_4_5757B32647BAE263266259B8A7DFFFC1"
#define MASS_ACCESSORY_STYLES "Styles_7_91DEB0F24E24D13FC9472882C11D0DFD"
#define MASS_ACCESSORY_RELPOS "RelativePosition_14_BE8FB2A94074F34B3EDA6683B227D3A1"
#define MASS_ACCESSORY_OFFPOS "RelativePositionOffset_15_98FD0CE74E44BBAFC2D46FB4CA4E0ED6"
#define MASS_ACCESSORY_RELROT "RelativeRotation_20_C78C73274E6E78E7878F8C98ECA342C0"
#define MASS_ACCESSORY_OFFROT "RelativeRotationOffset_21_E07FA0EC46728B7BA763C6861249ABAA"
#define MASS_ACCESSORY_SCALE "LocalScale_24_DC2D93A742A41A46E7E61D988F15ED53"
// Tuning stuff
#define MASS_ENGINE "Engine"
#define MASS_GEARS "Gears"
#define MASS_OS "OS"
#define MASS_MODULES "Modules"
#define MASS_ARCHITECT "Architect"
#define MASS_TECHS "Techs"