From ae91644c7393f29a056812ea3a551758398da98e Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 20 Sep 2023 23:54:51 -0300 Subject: Revamp how documentation tooltips work --- editor/property_selector.cpp | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) (limited to 'editor/property_selector.cpp') diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp index 5228db03b9..8c0a5b999a 100644 --- a/editor/property_selector.cpp +++ b/editor/property_selector.cpp @@ -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::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::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()) { -- cgit v1.2.3