From 4bfd539f99e34fa74fd1c9e32d79635bc9e8144d Mon Sep 17 00:00:00 2001 From: "ocean (they/them)" Date: Sat, 8 Apr 2023 16:26:41 -0400 Subject: [PATCH] Fix @export variable tooltips not showing up in Inspector when there is an inner class --- editor/editor_inspector.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index cd762002b2d..3a4bb571049 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2767,7 +2767,9 @@ void EditorInspector::update_tree() { // Update the docs reference and the label based on the script. Vector docs = scr->get_documentation(); if (!docs.is_empty()) { - doc_name = docs[0].name; + // The documentation of a GDScript's main class is at the end of the array. + // Hacky because this isn't necessarily always guaranteed. + doc_name = docs[docs.size() - 1].name; } if (script_name != StringName()) { label = script_name; @@ -3116,7 +3118,9 @@ void EditorInspector::update_tree() { if (scr.is_valid()) { Vector docs = scr->get_documentation(); if (!docs.is_empty()) { - classname = docs[0].name; + // The documentation of a GDScript's main class is at the end of the array. + // Hacky because this isn't necessarily always guaranteed. + classname = docs[docs.size() - 1].name; } } }