diff --git a/UniversalPropertyReplacement/UniversalPropertyReplacement.cpp b/UniversalPropertyReplacement/UniversalPropertyReplacement.cpp index e287c51..d5a3854 100644 --- a/UniversalPropertyReplacement/UniversalPropertyReplacement.cpp +++ b/UniversalPropertyReplacement/UniversalPropertyReplacement.cpp @@ -20,7 +20,6 @@ #include "stdafx.h" #include "UniversalPropertyReplacement.h" #include "VerificationCheat.h" -#include namespace UniversalPropertyReplacement { long AttachDetours() { @@ -32,10 +31,10 @@ namespace UniversalPropertyReplacement { return result; } bool Inititalize() { - App::ICheatManager::Get()->AddCheat("VerifyUPR", new VerificationCheat()); + CheatManager.AddCheat("VerifyUPR", new VerificationCheat()); uint32_t groupID = id("prop_overrides"); eastl::vector instanceList{}; - App::IPropManager::Get()->GetAllListIDs(groupID, instanceList); + PropManager.GetAllListIDs(groupID, instanceList); for (eastl_size_t i = 0; i < instanceList.size(); i++) { PropertyListPtr propList; @@ -65,185 +64,185 @@ namespace UniversalPropertyReplacement { bool value; result = App::Property::GetBool(propList.get(), id(valueString.c_str()), value); if (!result) continue; - boolValueMapOverride.emplace(eastl::pair{replaceHash, value}); + boolValueMapOverride[replaceHash] = value; } else if (typeString == "int32") { int32_t value; result = App::Property::GetInt32(propList.get(), id(valueString.c_str()), value); if (!result) continue; - int32ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + int32ValueMapOverride[replaceHash] = value; } else if (typeString == "uint32") { uint32_t value; result = App::Property::GetUInt32(propList.get(), id(valueString.c_str()), value); if (!result) continue; - uint32ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + uint32ValueMapOverride[replaceHash] = value; } else if (typeString == "float") { float value; result = App::Property::GetFloat(propList.get(), id(valueString.c_str()), value); if (!result) continue; - floatValueMapOverride.emplace(eastl::pair{replaceHash, value}); + floatValueMapOverride[replaceHash] = value; } else if (typeString == "string8") { eastl::string value; result = App::Property::GetString8(propList.get(), id(valueString.c_str()), value); if (!result) continue; - string8ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + string8ValueMapOverride[replaceHash] = value; } else if (typeString == "string16") { eastl::string16 value; result = App::Property::GetString16(propList.get(), id(valueString.c_str()), value); if (!result) continue; - string16ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + string16ValueMapOverride[replaceHash] = value; } else if (typeString == "key") { ResourceKey value; result = App::Property::GetKey(propList.get(), id(valueString.c_str()), value); if (!result) continue; - keyValueMapOverride.emplace(eastl::pair{replaceHash, value}); + keyValueMapOverride[replaceHash] = value; } else if (typeString == "text") { LocalizedString value; result = App::Property::GetText(propList.get(), id(valueString.c_str()), value); if (!result) continue; - textValueMapOverride.emplace(eastl::pair{replaceHash, value}); + textValueMapOverride[replaceHash] = value; } else if (typeString == "vector2") { Vector2 value; result = App::Property::GetVector2(propList.get(), id(valueString.c_str()), value); if (!result) continue; - vector2ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + vector2ValueMapOverride[replaceHash] = value; } else if (typeString == "vector3") { Vector3 value; result = App::Property::GetVector3(propList.get(), id(valueString.c_str()), value); if (!result) continue; - vector3ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + vector3ValueMapOverride[replaceHash] = value; } else if (typeString == "vector4") { Vector4 value; result = App::Property::GetVector4(propList.get(), id(valueString.c_str()), value); if (!result) continue; - vector4ValueMapOverride.emplace(eastl::pair{replaceHash, value}); + vector4ValueMapOverride[replaceHash] = value; } else if (typeString == "colorrgb") { ColorRGB value; result = App::Property::GetColorRGB(propList.get(), id(valueString.c_str()), value); if (!result) continue; - colorRGBValueMapOverride.emplace(eastl::pair{replaceHash, value}); + colorRGBValueMapOverride[replaceHash] = value; } else if (typeString == "colorrgba") { ColorRGBA value; result = App::Property::GetColorRGBA(propList.get(), id(valueString.c_str()), value); if (!result) continue; - colorRGBAValueMapOverride.emplace(eastl::pair{replaceHash, value}); + colorRGBAValueMapOverride[replaceHash] = value; } else if (typeString == "transform") { /*ManualBreakpoint(); Transform value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = *(out->GetValueTransform()); - transformValueMapOverride.emplace(eastl::pair{replaceHash, value});*/ + transformValueMapOverride[replaceHash] = value;*/ } else if (typeString == "bbox") { /*BoundingBox value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = *(out->GetValueBBox()); - bBoxValueMapOverride.emplace(eastl::pair{replaceHash, value});*/ + bBoxValueMapOverride[replaceHash] = value;*/ } else if (typeString == "bools") { bool* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueBool(); size = out->GetItemCount(); - boolValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + boolValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "int32s") { int32_t* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueInt32(); size = out->GetItemCount(); - int32ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + int32ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "uint32s") { uint32_t* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueUInt32(); size = out->GetItemCount(); - uint32ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + uint32ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "floats") { float* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueFloat(); size = out->GetItemCount(); - floatValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + floatValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "string8s") { eastl::string* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueString8(); size = out->GetItemCount(); - string8ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + string8ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "string16s") { eastl::string16* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueString16(); size = out->GetItemCount(); - string16ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + string16ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "keys") { ResourceKey* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueKey(); size = out->GetItemCount(); - keyValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + keyValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "texts") { LocalizedString* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueText(); size = out->GetItemCount(); - textValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + textValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "vector2s") { Vector2* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueVector2(); size = out->GetItemCount(); - vector2ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + vector2ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "vector3s") { Vector3* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueVector3(); size = out->GetItemCount(); - vector3ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + vector3ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "vector4s") { Vector4* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueVector4(); size = out->GetItemCount(); - vector4ValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + vector4ValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "colorrgbs") { ColorRGB* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueColorRGB(); size = out->GetItemCount(); - colorRGBValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + colorRGBValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "colorrgbas") { ColorRGBA* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueColorRGBA(); size = out->GetItemCount(); - colorRGBAValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + colorRGBAValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "transforms") { Transform* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueTransform(); size = out->GetItemCount(); - transformValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + transformValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } else if (typeString == "bboxs") { BoundingBox* value; - result = propList.get()->GetProperty(id(valueString.c_str()), out); + result = propList->GetProperty(id(valueString.c_str()), out); if (!result) continue; value = out->GetValueBBox(); size = out->GetItemCount(); - bBoxValueMapArrayOverride.emplace(eastl::pair>{replaceHash, {value, size}}); + bBoxValueMapArrayOverride[replaceHash] = eastl::pair{value, size}; } } } diff --git a/UniversalPropertyReplacement/VerificationCheat.cpp b/UniversalPropertyReplacement/VerificationCheat.cpp index d047948..9c3c26d 100644 --- a/UniversalPropertyReplacement/VerificationCheat.cpp +++ b/UniversalPropertyReplacement/VerificationCheat.cpp @@ -91,7 +91,7 @@ uint32_t GetPropertyId(eastl::string str) { void VerificationCheat::ParseLine(const ArgScript::Line& line) { PropertyListPtr propList; - App::IPropManager::Get()->GetPropertyList(id("VerifyUPR"), id("VerifyUPR"), propList); + PropManager.GetPropertyList(id("VerifyUPR"), id("VerifyUPR"), propList); App::Property* out; bool testFailed = false; @@ -187,7 +187,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { testFailed = true; } /*Transform transformTest; - if (propList.get()->GetProperty(GetPropertyId("transform"), out)) { + if (propList->GetProperty(GetPropertyId("transform"), out)) { transformTest = *(out->GetValueTransform()); if (VerifyValue(transformTest)) { ReportReplacementFailed("transform"); @@ -195,7 +195,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } }*/ /*BoundingBox bBoxTest; - if (propList.get()->GetProperty(GetPropertyId("bbox"), out)) { + if (propList->GetProperty(GetPropertyId("bbox"), out)) { bBoxTest = *(out->GetValueBBox()); if (VerifyValue(bBoxTest)) { ReportReplacementFailed("bbox"); @@ -206,7 +206,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { uint32_t count; bool* boolsTest; - if (propList.get()->GetProperty(GetPropertyId("bools"), out)) { + if (propList->GetProperty(GetPropertyId("bools"), out)) { boolsTest = out->GetValueBool(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(boolsTest[0]) && VerifyValue(boolsTest[1]))) { @@ -215,7 +215,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } int32_t* int32sTest; - if (propList.get()->GetProperty(GetPropertyId("int32s"), out)) { + if (propList->GetProperty(GetPropertyId("int32s"), out)) { int32sTest = out->GetValueInt32(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(int32sTest[0]) && VerifyValue(int32sTest[1]))) { @@ -224,7 +224,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } uint32_t* uint32sTest; - if (propList.get()->GetProperty(GetPropertyId("uint32s"), out)) { + if (propList->GetProperty(GetPropertyId("uint32s"), out)) { uint32sTest = out->GetValueUInt32(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(uint32sTest[0]) && VerifyValue(uint32sTest[1]))) { @@ -233,7 +233,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } float* floatsTest; - if (propList.get()->GetProperty(GetPropertyId("floats"), out)) { + if (propList->GetProperty(GetPropertyId("floats"), out)) { floatsTest = out->GetValueFloat(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(floatsTest[0]) && VerifyValue(floatsTest[1]))) { @@ -242,7 +242,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } eastl::string* string8sTest; - if (propList.get()->GetProperty(GetPropertyId("string8s"), out)) { + if (propList->GetProperty(GetPropertyId("string8s"), out)) { string8sTest = out->GetValueString8(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(string8sTest[0]) && VerifyValue(string8sTest[1]))) { @@ -251,7 +251,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } eastl::string16* string16sTest; - if (propList.get()->GetProperty(GetPropertyId("string16s"), out)) { + if (propList->GetProperty(GetPropertyId("string16s"), out)) { string16sTest = out->GetValueString16(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(string16sTest[0]) && VerifyValue(string16sTest[1]))) { @@ -260,7 +260,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } ResourceKey* keysTest; - if (propList.get()->GetProperty(GetPropertyId("keys"), out)) { + if (propList->GetProperty(GetPropertyId("keys"), out)) { keysTest = out->GetValueKey(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(keysTest[0]) && VerifyValue(keysTest[1]))) { @@ -269,7 +269,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } LocalizedString* textsTest; - if (propList.get()->GetProperty(GetPropertyId("texts"), out)) { + if (propList->GetProperty(GetPropertyId("texts"), out)) { textsTest = out->GetValueText(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(textsTest[0]) && VerifyValue(textsTest[1]))) { @@ -278,7 +278,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } Vector2* vector2sTest; - if (propList.get()->GetProperty(GetPropertyId("vector2s"), out)) { + if (propList->GetProperty(GetPropertyId("vector2s"), out)) { vector2sTest = out->GetValueVector2(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(vector2sTest[0]) && VerifyValue(vector2sTest[1]))) { @@ -287,7 +287,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } Vector3* vector3sTest; - if (propList.get()->GetProperty(GetPropertyId("vector3s"), out)) { + if (propList->GetProperty(GetPropertyId("vector3s"), out)) { vector3sTest = out->GetValueVector3(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(vector3sTest[0]) && VerifyValue(vector3sTest[1]))) { @@ -296,7 +296,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } Vector4* vector4sTest; - if (propList.get()->GetProperty(GetPropertyId("vector4s"), out)) { + if (propList->GetProperty(GetPropertyId("vector4s"), out)) { vector4sTest = out->GetValueVector4(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(vector4sTest[0]) && VerifyValue(vector4sTest[1]))) { @@ -305,7 +305,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } ColorRGB* colorRGBsTest; - if (propList.get()->GetProperty(GetPropertyId("colorRGBs"), out)) { + if (propList->GetProperty(GetPropertyId("colorRGBs"), out)) { colorRGBsTest = out->GetValueColorRGB(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(colorRGBsTest[0]) && VerifyValue(colorRGBsTest[1]))) { @@ -314,7 +314,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } ColorRGBA* colorRGBAsTest; - if (propList.get()->GetProperty(GetPropertyId("colorRGBAs"), out)) { + if (propList->GetProperty(GetPropertyId("colorRGBAs"), out)) { colorRGBAsTest = out->GetValueColorRGBA(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(colorRGBAsTest[0]) && VerifyValue(colorRGBAsTest[1]))) { @@ -323,7 +323,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } Transform* transformsTest; - if (propList.get()->GetProperty(GetPropertyId("transforms"), out)) { + if (propList->GetProperty(GetPropertyId("transforms"), out)) { transformsTest = out->GetValueTransform(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(transformsTest[0]) && VerifyValue(transformsTest[1]))) { @@ -332,7 +332,7 @@ void VerificationCheat::ParseLine(const ArgScript::Line& line) { } } BoundingBox* bBoxsTest; - if (propList.get()->GetProperty(GetPropertyId("bboxs"), out)) { + if (propList->GetProperty(GetPropertyId("bboxs"), out)) { bBoxsTest = out->GetValueBBox(); count = out->GetItemCount(); if (VerifyCount(count) || (VerifyValue(bBoxsTest[0]) && VerifyValue(bBoxsTest[1]))) {