Revamp how documentation tooltips work

This commit is contained in:
Michael Alexsander
2023-09-20 23:54:51 -03:00
parent f5696c311c
commit ae91644c73
10 changed files with 373 additions and 275 deletions

View File

@ -370,46 +370,15 @@ void PropertySelector::_item_selected() {
class_type = instance->get_class();
}
DocTools *dd = EditorHelp::get_doc_data();
String text;
if (properties) {
while (!class_type.is_empty()) {
HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(class_type);
if (E) {
for (int i = 0; i < E->value.properties.size(); i++) {
if (E->value.properties[i].name == name) {
text = DTR(E->value.properties[i].description);
break;
}
}
}
if (!text.is_empty()) {
break;
}
// The property may be from a parent class, keep looking.
class_type = ClassDB::get_parent_class(class_type);
while (!class_type.is_empty()) {
text = properties ? help_bit->get_property_description(class_type, name) : help_bit->get_method_description(class_type, name);
if (!text.is_empty()) {
break;
}
} else {
while (!class_type.is_empty()) {
HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(class_type);
if (E) {
for (int i = 0; i < E->value.methods.size(); i++) {
if (E->value.methods[i].name == name) {
text = DTR(E->value.methods[i].description);
break;
}
}
}
if (!text.is_empty()) {
break;
}
// The method may be from a parent class, keep looking.
class_type = ClassDB::get_parent_class(class_type);
}
// It may be from a parent class, keep looking.
class_type = ClassDB::get_parent_class(class_type);
}
if (!text.is_empty()) {