| 188 | } |
| 189 | |
| 190 | void HelpDisplay::LoadTooltips() |
| 191 | { |
| 192 | sTooltips.clear(); |
| 193 | |
| 194 | ModuleTooltipInfo moduleInfo; |
| 195 | UIControlTooltipInfo controlInfo; |
| 196 | |
| 197 | juce::File tooltipsFile(ofToResourcePath(UserPrefs.tooltips.Get())); |
| 198 | if (tooltipsFile.existsAsFile()) |
| 199 | { |
| 200 | juce::StringArray lines; |
| 201 | tooltipsFile.readLines(lines); |
| 202 | |
| 203 | for (int i = 0; i < lines.size(); ++i) |
| 204 | { |
| 205 | if (lines[i].isNotEmpty()) |
| 206 | { |
| 207 | juce::String line = lines[i].replace("\\n", "\n"); |
| 208 | std::vector<std::string> tokens = ofSplitString(line.toStdString(), "~"); |
| 209 | if (tokens.size() == 2) |
| 210 | { |
| 211 | if (!moduleInfo.module.empty()) |
| 212 | sTooltips.push_back(moduleInfo); //add this one and start a new one |
| 213 | moduleInfo.module = tokens[0]; |
| 214 | moduleInfo.tooltip = tokens[1]; |
| 215 | moduleInfo.controlTooltips.clear(); |
| 216 | } |
| 217 | else if (tokens.size() == 3) |
| 218 | { |
| 219 | controlInfo.controlName = tokens[1]; |
| 220 | controlInfo.tooltip = tokens[2]; |
| 221 | moduleInfo.controlTooltips.push_back(controlInfo); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | sTooltips.push_back(moduleInfo); //get the last one |
| 228 | |
| 229 | sTooltipsLoaded = true; |
| 230 | } |
| 231 | |
| 232 | HelpDisplay::ModuleTooltipInfo* HelpDisplay::FindModuleInfo(std::string moduleTypeName) |
| 233 | { |
nothing calls this directly
no test coverage detected