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

Method LoadTooltips

Source/HelpDisplay.cpp:190–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190void 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
232HelpDisplay::ModuleTooltipInfo* HelpDisplay::FindModuleInfo(std::string moduleTypeName)
233{

Callers

nothing calls this directly

Calls 5

ofToResourcePathFunction · 0.85
ofSplitStringFunction · 0.85
GetMethod · 0.80
sizeMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected