MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Path

Method Path

Source/IClickable.cpp:142–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142std::string IClickable::Path(bool ignoreContext, bool useDisplayName)
143{
144 if (mName[0] == 0) //must have a name
145 return "";
146
147 std::string name = useDisplayName ? GetDisplayName() : mName;
148
149 std::string path = name;
150 if (mParent != nullptr)
151 path = mParent->Path(true) + "~" + name;
152
153 if (!ignoreContext)
154 {
155 if (sPathLoadContext != "")
156 {
157 if (path[0] == '$')
158 {
159 if (Prefab::sLoadingPrefab)
160 path = "";
161 else
162 path = path.substr(1, path.length() - 1);
163 }
164 else
165 {
166 path = sPathLoadContext + path;
167 }
168 }
169 if (sPathSaveContext != "")
170 {
171 if (strstr(path.c_str(), sPathSaveContext.c_str()) == path.c_str()) //path starts with sSaveContext
172 path = path.substr(sPathSaveContext.length(), path.length() - sPathSaveContext.length());
173 else
174 path = "$" + path; //path is outside of our context, and therefore invalid
175 }
176 }
177 return path;
178}
179
180bool IClickable::CheckNeedsDraw()
181{

Callers 15

PollMethod · 0.80
OnKeyPressedMethod · 0.80
SaveStateMethod · 0.80
DrawControlsMethod · 0.80
SaveLayoutMethod · 0.80
ResyncControllerStateMethod · 0.80
SaveLayoutMethod · 0.80
SetUIControlMethod · 0.80
PollMethod · 0.80
SaveStateMethod · 0.80
DrawMethod · 0.80
SaveLayoutMethod · 0.80

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected