summaryrefslogtreecommitdiff
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-31 22:28:05 +0200
committerGitHub <noreply@github.com>2022-07-31 22:28:05 +0200
commit214d0b20b0690721e5eaaca0b73e17fac35f0a14 (patch)
tree8c38454c6db88ef27494618d392d65ececb1b367 /editor/editor_inspector.cpp
parent7686cfec64a9cbfe1c27bfa4f8b1eaf43755830e (diff)
parent8ee125a128717da54bd1a3313a4b54ad767d7ea4 (diff)
Merge pull request #62936 from Xwdit/script_doc_inspector_property
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 57acc0b2c5..133a4a3398 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2479,6 +2479,8 @@ void EditorInspector::update_tree() {
_parse_added_editors(main_vbox, ped);
}
+ StringName type_name;
+
// Get the lists of editors for properties.
for (List<PropertyInfo>::Element *E_property = plist.front(); E_property; E_property = E_property->next()) {
PropertyInfo &p = E_property->get();
@@ -2549,6 +2551,7 @@ void EditorInspector::update_tree() {
category_vbox = nullptr; //reset
String type = p.name;
+ type_name = p.name;
// Set the category icon.
if (!ClassDB::class_exists(type) && !ScriptServer::is_global_class(type) && p.hint_string.length() && FileAccess::exists(p.hint_string)) {
@@ -2582,18 +2585,17 @@ void EditorInspector::update_tree() {
if (use_doc_hints) {
// Sets the category tooltip to show documentation.
- StringName type2 = p.name;
- if (!class_descr_cache.has(type2)) {
+ if (!class_descr_cache.has(type_name)) {
String descr;
DocTools *dd = EditorHelp::get_doc_data();
- HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(type2);
+ HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(type_name);
if (E) {
descr = DTR(E->value.brief_description);
}
- class_descr_cache[type2] = descr;
+ class_descr_cache[type_name] = descr;
}
- category->set_tooltip(p.name + "::" + (class_descr_cache[type2].is_empty() ? "" : class_descr_cache[type2]));
+ category->set_tooltip(p.name + "::" + (class_descr_cache[type_name].is_empty() ? "" : class_descr_cache[type_name]));
}
// Add editors at the start of a category.
@@ -2864,7 +2866,7 @@ void EditorInspector::update_tree() {
// Build the doc hint, to use as tooltip.
// Get the class name.
- StringName classname = object->get_class_name();
+ StringName classname = type_name == "" ? object->get_class_name() : type_name;
if (!object_class.is_empty()) {
classname = object_class;
}