MCPcopy Create free account
hub / github.com/Lovrom8/RSMods / SaveInitialStringPos

Function SaveInitialStringPos

DLL/CC/Effects/InvertedStringsEffect.cpp:38–56  ·  view source on GitHub ↗

Save the original positioning from the guitar strings

Source from the content-addressed store, hash-verified

36 /// Save the original positioning from the guitar strings
37 /// </summary>
38 void SaveInitialStringPos() {
39 // Get the root object, and it's children.
40 ObjectUtil::Object* rootObject = ObjectUtil::GetRootObject();
41 std::vector<ObjectUtil::Object*> children = ObjectUtil::GetChildrenOfObject(rootObject);
42
43 LOG_INFO(children.size() << "/" << rootObject->childCount << std::endl);
44
45 for (auto child : children)
46 {
47 std::string className = child->className;
48
49 // Only save the guitar / bass strings positions.
50 if (className.find("String") != std::string::npos || className.find("string") != std::string::npos){
51 stringObjs.push_back(child);
52 stringPositions.push_back(StrPos(child->x, child->y, child->z));
53 LOG_INFO(className << std::endl);
54 }
55 }
56 }
57
58 /// <summary>
59 /// Set the string positions to the opposite string.

Callers 1

StartMethod · 0.85

Calls 6

GetRootObjectFunction · 0.85
GetChildrenOfObjectFunction · 0.85
StrPosClass · 0.85
findMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected