summaryrefslogtreecommitdiffstats
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp42
1 files changed, 16 insertions, 26 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index cdb187bd44..f0f7f87711 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -35,14 +35,14 @@
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/version.h"
-#include "doc_data_compressed.gen.h"
+#include "editor/doc_data_compressed.gen.h"
#include "editor/editor_node.h"
#include "editor/editor_paths.h"
#include "editor/editor_property_name_processor.h"
-#include "editor/editor_scale.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/plugins/script_editor_plugin.h"
+#include "editor/themes/editor_scale.h"
#include "scene/gui/line_edit.h"
#define CONTRIBUTE_URL vformat("%s/contributing/documentation/updating_the_class_reference.html", VERSION_DOCS_URL)
@@ -812,35 +812,25 @@ void EditorHelp::_update_doc() {
class_desc->add_newline();
}
- // Descendents
- if (cd.is_script_doc || ClassDB::class_exists(cd.name)) {
- bool found = false;
- bool prev = false;
-
+ // Descendants
+ if ((cd.is_script_doc || ClassDB::class_exists(cd.name)) && doc->inheriting.has(cd.name)) {
_push_normal_font();
- for (const KeyValue<String, DocData::ClassDoc> &E : doc->class_list) {
- if (E.value.inherits == cd.name) {
- if (!found) {
- class_desc->push_color(theme_cache.title_color);
- class_desc->add_text(TTR("Inherited by:") + " ");
- found = true;
- }
+ class_desc->push_color(theme_cache.title_color);
+ class_desc->add_text(TTR("Inherited by:") + " ");
- if (prev) {
- class_desc->add_text(" , ");
- }
- _add_type_icon(E.value.name, theme_cache.doc_font_size, "ArrowRight");
- class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type().
- _add_type(E.value.name);
- prev = true;
+ for (RBSet<String, NaturalNoCaseComparator>::Element *itr = doc->inheriting[cd.name].front(); itr; itr = itr->next()) {
+ if (itr->prev()) {
+ class_desc->add_text(" , ");
}
+
+ _add_type_icon(itr->get(), theme_cache.doc_font_size, "ArrowRight");
+ class_desc->add_text(non_breaking_space); // Otherwise icon borrows hyperlink from _add_type().
+ _add_type(itr->get());
}
_pop_normal_font();
- if (found) {
- class_desc->pop();
- class_desc->add_newline();
- }
+ class_desc->pop();
+ class_desc->add_newline();
}
// Note if deprecated.
@@ -1966,7 +1956,7 @@ void EditorHelp::_help_callback(const String &p_topic) {
}
if (class_desc->is_ready()) {
- class_desc->call_deferred(SNAME("scroll_to_paragraph"), line);
+ callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).call_deferred(line);
} else {
scroll_to = line;
}