summaryrefslogtreecommitdiff
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 4f7432cd65..a0c106441a 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -35,6 +35,7 @@
#include "doc_data_compressed.gen.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor_node.h"
+#include "editor_scale.h"
#include "editor_settings.h"
#define CONTRIBUTE_URL "https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html"
@@ -185,11 +186,11 @@ void EditorHelp::_class_desc_resized() {
void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
String t = p_type;
- if (t == "")
+ if (t.empty())
t = "void";
- bool can_ref = (t != "int" && t != "real" && t != "bool" && t != "void") || p_enum != String();
+ bool can_ref = (t != "void") || !p_enum.empty();
- if (p_enum != String()) {
+ if (!p_enum.empty()) {
if (p_enum.get_slice_count(".") > 1) {
t = p_enum.get_slice(".", 1);
} else {
@@ -200,7 +201,7 @@ void EditorHelp::_add_type(const String &p_type, const String &p_enum) {
const Color type_color = get_color("accent_color", "Editor").linear_interpolate(text_color, 0.5);
class_desc->push_color(type_color);
if (can_ref) {
- if (p_enum == "") {
+ if (p_enum.empty()) {
class_desc->push_meta("#" + t); //class
} else {
class_desc->push_meta("$" + p_enum); //class
@@ -798,7 +799,7 @@ void EditorHelp::_update_doc() {
class_desc->pop();
class_desc->push_font(doc_code_font);
String e = E->key();
- if (e.get_slice_count(".")) {
+ if ((e.get_slice_count(".") > 1) && (e.get_slice(".", 0) == edited_class)) {
e = e.get_slice(".", 1);
}