diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 7919d61f26a..aed1462eb61 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3220,12 +3220,13 @@ void EditorInspector::update_tree() { } // Search for the doc path in the cache. - HashMap>::Iterator E = doc_path_cache.find(classname); + HashMap>::Iterator E = doc_cache.find(classname); if (E) { - HashMap::Iterator F = E->value.find(propname); + HashMap::Iterator F = E->value.find(propname); if (F) { found = true; - doc_path = F->value; + doc_path = F->value.doc_path; + theme_item_name = F->value.theme_item_name; } } @@ -3246,23 +3247,22 @@ void EditorInspector::update_tree() { theme_item_name = F->value.theme_properties[i].name; } } - - if (is_native_class) { - doc_path_cache[classname][propname] = doc_path; - } } else { for (int i = 0; i < F->value.properties.size(); i++) { String doc_path_current = "class_property:" + F->value.name + ":" + F->value.properties[i].name; if (F->value.properties[i].name == propname.operator String()) { doc_path = doc_path_current; } - - if (is_native_class) { - doc_path_cache[classname][propname] = doc_path; - } } } + if (is_native_class) { + DocCacheInfo cache_info; + cache_info.doc_path = doc_path; + cache_info.theme_item_name = theme_item_name; + doc_cache[classname][propname] = cache_info; + } + if (!doc_path.is_empty() || F->value.inherits.is_empty()) { break; } diff --git a/editor/editor_inspector.h b/editor/editor_inspector.h index 8c55950a2b4..eff4f9caa54 100644 --- a/editor/editor_inspector.h +++ b/editor/editor_inspector.h @@ -505,7 +505,12 @@ class EditorInspector : public ScrollContainer { int property_focusable; int update_scroll_request; - HashMap> doc_path_cache; + struct DocCacheInfo { + String doc_path; + String theme_item_name; + }; + + HashMap> doc_cache; HashSet restart_request_props; HashMap custom_property_descriptions;