| 140 | } |
| 141 | |
| 142 | std::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 | |
| 180 | bool IClickable::CheckNeedsDraw() |
| 181 | { |
no test coverage detected